|
@@ -6,7 +6,7 @@ use app\common\controller\Backend;
|
|
|
use think\Db;
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ *
|
|
|
*
|
|
|
* @icon fa fa-circle-o
|
|
|
*/
|
|
@@ -36,7 +36,7 @@ class Coupon extends Backend
|
|
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
|
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查看
|
|
@@ -55,7 +55,7 @@ class Coupon extends Backend
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
|
|
|
$list = $this->model
|
|
|
-
|
|
|
+
|
|
|
->where($where)
|
|
|
->order($sort, $order)
|
|
|
->paginate($limit);
|
|
@@ -92,6 +92,9 @@ class Coupon extends Backend
|
|
|
$coupon=new \app\admin\model\Coupon();
|
|
|
$coupon->allowField(true)->data($data)->save();
|
|
|
$goods_id=array_filter(explode(',',$data['goods_id']));
|
|
|
+ if(!$goods_id){
|
|
|
+ $goods_id=\app\admin\model\Goods::show()->column('id');
|
|
|
+ }
|
|
|
$arr=[];
|
|
|
foreach ($goods_id as $id){
|
|
|
$new['goods_id']=$id;
|