|
@@ -3409,7 +3409,7 @@ class Sale extends Base
|
|
|
// $where[]=["a.apply_id","in",$role['write']];
|
|
|
$cgdArr =\think\facade\Config::get("app");
|
|
|
$cgdids =implode(",",$cgdArr['wsm_cgder_role']);
|
|
|
- $condition .= " (b.is_stock=1 and {$this->roleid} in ($cgdids)) or (b.is_stock=0 and wpo.cgder_id = {$this->uid}) or a.apply_id in (" . implode(',', $role['write']) . ")";
|
|
|
+ $condition .= " (b.is_stock=1 and {$this->roleid} in ($cgdids)) or (b.is_stock=0 and sip.personid = {$this->uid}) or a.apply_id in (" . implode(',', $role['write']) . ")";
|
|
|
}
|
|
|
// if(!empty($role['platform']) ){
|
|
|
// $where[]=["b.platform_id","in",$role['platform']];
|
|
@@ -3434,6 +3434,7 @@ class Sale extends Base
|
|
|
->leftJoin("depart_user u", "u.uid=a.apply_id AND u.is_del=0")
|
|
|
->leftJoin("order_send os", "os.outCode=a.outCode")
|
|
|
->leftJoin("purchease_order wpo", "wpo.cgdNo=os.cgdNo")
|
|
|
+ ->leftJoin('supplier sip', 'sip.code=wpo.supplierNo')
|
|
|
->where($where)
|
|
|
->where($condition)
|
|
|
->count();
|
|
@@ -3447,6 +3448,7 @@ class Sale extends Base
|
|
|
->leftJoin("order_send os", "os.outCode=a.outCode")
|
|
|
->leftJoin("purchease_order wpo", "wpo.cgdNo=os.cgdNo")
|
|
|
->leftJoin("depart_user u", "u.uid=a.apply_id AND u.is_del=0")
|
|
|
+ ->leftJoin('supplier sip', 'sip.code=wpo.supplierNo')
|
|
|
->field("a.*,b.order_type,b.order_source,b.good_name,b.good_code,b.skuCode,b.supplierNo,b.customer_code,v.companyName,b.origin_price,b.sale_price,b.total_price,os.cgdNo,u.itemid")
|
|
|
->where($where)
|
|
|
->where($condition)
|
|
@@ -3645,6 +3647,7 @@ class Sale extends Base
|
|
|
$addrid = Db::name("order_addr")->insert($addrlst, true);
|
|
|
if ($addrid > 0) {
|
|
|
$outCode = makeNo("DF");
|
|
|
+ $order=[];
|
|
|
if($der['order_type']!=1){
|
|
|
$order = Db::name("order_num")->where(["orderCode" => $orderCode, "status" => 1])->where([["wsend_num", ">=", 0]])
|
|
|
->lock(true)->find();
|