Browse Source

商品下线详情根据spuCode查询

wufeng 2 years ago
parent
commit
150c1297ff
2 changed files with 21 additions and 7 deletions
  1. 4 4
      app/admin/controller/GoodOfflineLog.php
  2. 17 3
      app/admin/controller/Proorder.php

+ 4 - 4
app/admin/controller/GoodOfflineLog.php

@@ -36,16 +36,16 @@ class GoodOfflineLog extends Base
     public function getDetail()
     {
 
-        $id = $this->request->post('id', null, 'trim');
+        $spuCode = $this->request->post('spuCode', null, 'trim');
 
-        $val = Validate::rule(['id|ID' => 'require|number|gt:0']);
+        $val = Validate::rule(['spuCode' => 'require']);
 
-        if (!$val->check(['id' => $id])) return error_show(1004, $val->getError());
+        if (!$val->check(['spuCode' => $spuCode])) return error_show(1004, $val->getError());
         else {
             $res = Db::name('good_offline_log')
                 ->alias('gol')
                 ->field('gol.*,ri.result')
-                ->where('gol.id', $id)
+                ->where('gol.spuCode', $spuCode)
                 ->leftJoin('result_info ri', 'ri.result_code=gol.offline_reason')
                 ->find();
 

+ 17 - 3
app/admin/controller/Proorder.php

@@ -60,12 +60,26 @@ public function waitlist(){
     if($action_uid!=""){
         $where[]=["a.action_uid","=",$action_uid];
     }
-    $count = Db::name('process_wait')->alias("a")->leftJoin("workflow b","a.order_type=b.order_type and a.order_code=b.order_code")->where($comd)->where($where)->count();
+    $count = Db::name('process_wait')
+        ->alias("a")
+        ->leftJoin("workflow b","a.order_type=b.order_type and a.order_code=b.order_code")
+        ->where($comd)
+        ->where($where)
+        ->count();
+
     $total = ceil("$count/$size");
     $page = $page>$total ? $total:$page;
-    $list = Db::name('process_wait')->alias("a")->leftJoin("workflow b","a.order_type=b.order_type and a.order_code=b.order_code")
+    $list = Db::name('process_wait')
+        ->alias("a")
         ->field("b.apply_id,b.apply_name,a.addtime,a.action_uid,a.action_name,a.order_status,a.order_type,a.order_process,a.order_code,a.order_id,a.id")
-        ->where($where)->where($comd)->page($page,$size)->order("a.addtime desc")->select();
+        ->leftJoin("workflow b","a.order_type=b.order_type and a.order_code=b.order_code")
+        ->where($where)
+        ->where($comd)
+        ->page($page,$size)
+        ->fetchSql()
+        ->order("a.addtime desc")
+        ->select();
+    
     $data=[];//->field("status,order_name,process_name")
     foreach ($list as $value) {
         $str = Db::name("process")->where(['process_type' => $value['order_type']])->field("process_name,status")->find();