sync order status
This commit is contained in:
parent
bc399735a9
commit
4f1b0a5380
@ -9,6 +9,7 @@ use App\Models\MedicalReport;
|
||||
use App\Models\NewFatLog;
|
||||
use App\Models\OfflineOrder;
|
||||
use App\Models\Order;
|
||||
use App\Models\ServiceOrderStatus;
|
||||
use App\Models\ServiceRoleOrder;
|
||||
use App\Models\UserInfo;
|
||||
use App\Models\Version;
|
||||
@ -915,4 +916,25 @@ class TestController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启所有服务人员接单状态
|
||||
* @return void
|
||||
*/
|
||||
public function OpenRoleOrderStatus()
|
||||
{
|
||||
$user_ids = DmaServiceUserRole::where("status", 1)->distinct("user_id")->pluck("user_id")->toArray();
|
||||
|
||||
foreach ($user_ids as $user_id) {
|
||||
$orderStatus = ServiceOrderStatus::where("user_id", $user_id)->first();
|
||||
if ($orderStatus)
|
||||
continue;
|
||||
|
||||
ServiceOrderStatus::create([
|
||||
"user_id" => $user_id,
|
||||
"order_status" => 1,
|
||||
"last_owner" => 0,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user