|
@@ -25,7 +25,7 @@ class Good extends \app\BaseController
|
|
|
public function list(){
|
|
|
$page = isset($this->post['page']) &&$this->post['page'] !=="" ? intval($this->post['page']):1;
|
|
|
$size = isset($this->post['size']) &&$this->post['size'] !=="" ? intval($this->post['size']):10;
|
|
|
- $condtion=["a.is_del"=>0,"b.is_del"=>0,"c.is_del"=>0];
|
|
|
+ $condtion=["a.is_del"=>0,"b.is_del"=>0];
|
|
|
$wsmcode =isset($this->post['wsmcode']) &&$this->post['wsmcode'] !=="" ? trim($this->post['wsmcode']):"";
|
|
|
if($wsmcode!=""){
|
|
|
$condtion["c.wsm_code"] = $wsmcode;
|
|
@@ -50,10 +50,10 @@ class Good extends \app\BaseController
|
|
|
|
|
|
$count = Db::name("good_type")->alias("b")->join("good a","a.good_code = b.good_code","left")
|
|
|
->join("good_stock c","c.good_type_code = b.type_code","left")
|
|
|
- ->where($condtion)->count();
|
|
|
+ ->where($condtion)->where("c.is_del=0 or c.is_del is null")->count();
|
|
|
$page>=ceil($count/$size) ? $page=ceil($count/$size) :"";
|
|
|
$list = Db::name("good_type")->alias("b")->join("good a","a.good_code = b.good_code","left")
|
|
|
- ->join("good_stock c","c.good_type_code = b.type_code","left")->where($condtion)
|
|
|
+ ->join("good_stock c","c.good_type_code = b.type_code","left")->where($condtion)->where("c.is_del=0 or c.is_del is null")
|
|
|
->field("b.id,a.good_code,a.good_name,a.good_desc,a.brand,a.original_price,a.cg_saler,a.good_type,a.market_fee,a.gys_code,a.unit,
|
|
|
a.sort_f,a.sort_s,a.sort_t,b.color,b.material,b.specs,b.is_main,b.type_code,b.attribute,b.status as bstatus,a.addtime,a.updatetime")
|
|
|
->page($page,$size)->select();
|