|
|
@@ -4,6 +4,7 @@ namespace App\Services;
|
|
|
|
|
|
use App\CommodityBarcode;
|
|
|
use App\DeliveryAppointmentDetail;
|
|
|
+use App\Owner;
|
|
|
use App\Services\common\QueryService;
|
|
|
use App\Traits\ServiceAppAop;
|
|
|
use App\DeliveryAppointment;
|
|
|
@@ -211,11 +212,14 @@ class DeliveryAppointmentService
|
|
|
* 检查可操作ASN
|
|
|
*
|
|
|
* @param string $asn
|
|
|
- * @param string $customerid
|
|
|
+ * @param string $ownerCode
|
|
|
* @return bool
|
|
|
*/
|
|
|
- public function checkOperableAsn(string $asn,string $customerid):bool
|
|
|
+ public function checkOperableAsn(string $asn,string $ownerCode):bool
|
|
|
{
|
|
|
- return true;
|
|
|
+ if (!Owner::query()->where("code",$ownerCode)->where("is_check_asn",1)->first())return true;
|
|
|
+ return !!DeliveryAppointment::query()->selectRaw("1")->where("status",'!=',1)
|
|
|
+ ->where("appointment_date",date("Y-m-d"))
|
|
|
+ ->where("asn_number",'like',"%{$asn}%")->first();
|
|
|
}
|
|
|
}
|