|
|
@@ -10,6 +10,8 @@ use App\Console\Commands\CreateOwnerAreaReport;
|
|
|
use App\Console\Commands\CreateOwnerBillReport;
|
|
|
use App\Console\Commands\CreateOwnerReport;
|
|
|
use App\Console\Commands\WasSyncWmsAsnInformation;
|
|
|
+use App\DeliveryAppointment;
|
|
|
+use App\DeliveryAppointmentDetail;
|
|
|
use App\Events\BroadcastToStation;
|
|
|
use App\Events\SendEmailEvent;
|
|
|
use App\Exceptions\Exception;
|
|
|
@@ -134,6 +136,25 @@ class TestController extends Controller
|
|
|
return call_user_func([$this, $method], $request);
|
|
|
}
|
|
|
|
|
|
+ public function test1()
|
|
|
+ {
|
|
|
+ ini_set('max_execution_time',-1);
|
|
|
+ DeliveryAppointment::query()->with("details")->whereNotNull("asn_number")->get()->each(function ($d){
|
|
|
+ $asn = preg_split('/[,, ]+/is', $d->asn_number);
|
|
|
+ if ($asn && strlen($d->asn_number)>=13){
|
|
|
+ Store::query()->whereIn("asn_code",$asn)->where("owner_id",$d->owner_id)
|
|
|
+ ->with("storeItems")->get()->each(function ($store)use($d){
|
|
|
+ $store->storeItems->each(function ($item)use($d){
|
|
|
+ $de = DeliveryAppointmentDetail::query()->where("delivery_appointment_id",$d->id)
|
|
|
+ ->where("commodity_id",$item->commodity_id)->first();
|
|
|
+ if ($de && $item->expected_amount && $de->amount!=$item->expected_amount)$de->update(["amount"=>$item->expected_amount]);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ dd("OK");
|
|
|
+ }
|
|
|
+
|
|
|
public function test()
|
|
|
{
|
|
|
dd(app("MenuService")->getVisibleFunctionList());
|
|
|
@@ -200,22 +221,6 @@ class TestController extends Controller
|
|
|
app("MenuService")->setMenu();//重建菜单缓存
|
|
|
app("AuthorityService")->removeAllAuth();//移除所有用户权限缓存,这将在用户下次访问时重新建立
|
|
|
}
|
|
|
- public function test1(){
|
|
|
- DB::beginTransaction();
|
|
|
- try{
|
|
|
- DB::beginTransaction();
|
|
|
- try{
|
|
|
- $unit = Unit::query()->first();
|
|
|
- $unit->update(["name"=>"xxx"]);
|
|
|
- DB::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- DB::rollBack();
|
|
|
- }
|
|
|
- DB::commit();
|
|
|
- }catch (\Exception $e){
|
|
|
- DB::rollBack();
|
|
|
- }
|
|
|
- }
|
|
|
public function orderCreateBill()
|
|
|
{
|
|
|
$order = Order::query()->find(\request("id"));
|