fix: 完善取消退款恢复与师傅端流程
这个提交包含在:
@@ -4,6 +4,7 @@ namespace app\api\controller;
|
||||
|
||||
use app\common\library\CommissionService;
|
||||
use app\common\library\FinanceConfigService;
|
||||
use app\common\library\FinishImageUrls;
|
||||
use app\common\library\OrderStatus;
|
||||
use app\common\library\PaymentService;
|
||||
use app\common\library\TiandituService;
|
||||
@@ -98,11 +99,9 @@ class Master extends Base
|
||||
}
|
||||
|
||||
// 若是驳回后重提且未修改脱敏展示号,沿用原存储的完整身份证号;否则校验完整身份证号并真实入库
|
||||
$needVerify = true;
|
||||
if (strpos($rawIdcard, '*') !== false) {
|
||||
if ($exist && !empty($exist['idcard_no']) && strpos((string)$exist['idcard_no'], '*') === false) {
|
||||
$finalIdcard = (string)$exist['idcard_no'];
|
||||
$needVerify = false;
|
||||
} else {
|
||||
$this->error('请填写真实完整的18位身份证号码');
|
||||
return;
|
||||
@@ -125,12 +124,10 @@ class Master extends Base
|
||||
}
|
||||
|
||||
// 腾讯云公安权威二要素实名核验(姓名 + 身份证号)
|
||||
if ($needVerify) {
|
||||
$verifyRes = TencentVerifyService::verifyIdCard($realname, $finalIdcard);
|
||||
if (!$verifyRes['pass']) {
|
||||
$this->error('实名核验未通过:' . $verifyRes['msg']);
|
||||
return;
|
||||
}
|
||||
$verifyRes = TencentVerifyService::verifyIdCard($realname, $finalIdcard);
|
||||
if (!$verifyRes['pass']) {
|
||||
$this->error('实名核验未通过:' . $verifyRes['msg']);
|
||||
return;
|
||||
}
|
||||
|
||||
$catNameMap = Db::name('service_cat')->where('id', 'in', $skillCatIds)->column('name', 'id');
|
||||
@@ -144,9 +141,10 @@ class Master extends Base
|
||||
'cert_images' => $certImages,
|
||||
'city' => $normalizedCity,
|
||||
'work_status' => 'off',
|
||||
'verify_status' => 'pass',
|
||||
'audit_msg' => '腾讯云二要素实名核验通过',
|
||||
'audittime' => time(),
|
||||
'verify_status' => 'pending',
|
||||
'audit_msg' => '',
|
||||
'audittime' => null,
|
||||
'audit_admin_id' => 0,
|
||||
'updatetime' => time(),
|
||||
];
|
||||
|
||||
@@ -180,7 +178,7 @@ class Master extends Base
|
||||
$this->error('提交失败:' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->success('实名认证成功,已获得接单资格!', ['master_id' => (int)$masterId]);
|
||||
$this->success('申请已提交,请等待后台审核', ['master_id' => (int)$masterId, 'verify_status' => 'pending']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,7 +310,7 @@ class Master extends Base
|
||||
*/
|
||||
public function updateLocation()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$rawLat = $this->request->post('lat', '');
|
||||
$rawLng = $this->request->post('lng', '');
|
||||
if (!$this->isValidCoord($rawLat, $rawLng)) {
|
||||
@@ -389,7 +387,7 @@ class Master extends Base
|
||||
*/
|
||||
public function searchLocation()
|
||||
{
|
||||
$this->requireMaster();
|
||||
$this->requireMasterProfile();
|
||||
$keyword = trim((string)$this->request->param('keyword', ''));
|
||||
if (mb_strlen($keyword) < 2) {
|
||||
$this->success('', ['list' => []]);
|
||||
@@ -410,7 +408,7 @@ class Master extends Base
|
||||
*/
|
||||
public function locationContext()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$rawLat = $this->request->param('lat', '');
|
||||
$rawLng = $this->request->param('lng', '');
|
||||
$category = trim((string)$this->request->param('category', 'all'));
|
||||
@@ -473,7 +471,7 @@ class Master extends Base
|
||||
*/
|
||||
public function locationOrderStats()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$rawLat = $this->request->param('lat', '');
|
||||
$rawLng = $this->request->param('lng', '');
|
||||
$city = trim((string)$this->request->param('city', ''));
|
||||
@@ -496,7 +494,7 @@ class Master extends Base
|
||||
*/
|
||||
public function locateCity()
|
||||
{
|
||||
$this->requireMaster();
|
||||
$this->requireMasterProfile();
|
||||
$city = trim((string)$this->request->param('city', ''));
|
||||
if ($city === '') {
|
||||
$this->error('请提供城市名称');
|
||||
@@ -529,7 +527,7 @@ class Master extends Base
|
||||
*/
|
||||
public function hall()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$this->recycleExpired();
|
||||
|
||||
$catIds = $this->getMasterSkillCatIds((int)$master['id']);
|
||||
@@ -989,7 +987,7 @@ class Master extends Base
|
||||
public function finish()
|
||||
{
|
||||
$order = $this->ownOrder((int)$this->request->post('order_id'), 'master');
|
||||
$images = (array)$this->request->post('images/a', []);
|
||||
$images = FinishImageUrls::normalize((array)$this->request->post('images/a', []));
|
||||
$damage = trim((string)$this->request->post('damage_remark', ''));
|
||||
|
||||
Db::startTrans();
|
||||
@@ -1142,7 +1140,7 @@ class Master extends Base
|
||||
|
||||
public function orders()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$status = $this->request->param('status', 'active');
|
||||
$page = max(1, (int)$this->request->param('page', 1));
|
||||
$limit = min(30, max(1, (int)$this->request->param('limit', 10)));
|
||||
@@ -1198,7 +1196,7 @@ class Master extends Base
|
||||
*/
|
||||
public function income()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
|
||||
// 顺带轻量同步最新 3 笔处理中的微信转账提现单(如师傅上次已确认收款但未回调或超时自动退回)
|
||||
$syncCandidates = Db::name('withdraw')
|
||||
@@ -1637,7 +1635,7 @@ class Master extends Base
|
||||
*/
|
||||
public function credit()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$mid = (int)$master['id'];
|
||||
|
||||
$reviewTotal = (int)Db::name('review')->where('master_id', $mid)->where('status', 'normal')->count();
|
||||
@@ -1671,7 +1669,7 @@ class Master extends Base
|
||||
*/
|
||||
public function appeals()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$list = Db::name('appeal')->where('master_id', $master['id'])->order('id desc')->limit(30)->select();
|
||||
$typeText = ['misjudge' => '误判申诉', 'review' => '恶意评价', 'deduct' => '扣款申诉', 'other' => '其他'];
|
||||
$statusText = ['wait' => '待处理', 'handling' => '处理中', 'done' => '已处理', 'reject' => '已驳回'];
|
||||
@@ -1749,7 +1747,7 @@ class Master extends Base
|
||||
*/
|
||||
public function quotes()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$list = Db::name('order_quote')->alias('q')
|
||||
->join('order o', 'o.id = q.order_id', 'LEFT')
|
||||
->field('q.*, o.order_no, o.service_name, o.pay_amount as order_amount, o.status as order_status')
|
||||
@@ -1994,7 +1992,7 @@ class Master extends Base
|
||||
|
||||
public function orderDetail()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$masterId = (int)$master['id'];
|
||||
$orderId = (int)$this->request->param('id') ?: (int)$this->request->param('order_id');
|
||||
if ($orderId <= 0) {
|
||||
@@ -2579,7 +2577,7 @@ class Master extends Base
|
||||
*/
|
||||
public function saveSkills()
|
||||
{
|
||||
$master = $this->requireMaster();
|
||||
$master = $this->requireMasterProfile();
|
||||
$masterId = (int)$master['id'];
|
||||
|
||||
// 同时兼容 skill_ids(ID 数组/逗号串/JSON串)与 selected_skills(名称数组/逗号串/JSON串)
|
||||
|
||||
在新工单中引用
屏蔽一个用户