1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- /**
- * @author: xaboy<365615158@qq.com>
- * @day: 2017/11/11
- */
- namespace app\admin\model\ump;
- use crmeb\services\FormBuilder as Form;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- use think\facade\Route as Url;
- use app\admin\model\store\StoreCategory as CategoryModel;
- /**
- * Class StoreCategory
- * @package app\admin\model\store
- */
- class WriteOff extends BaseModel
- {
- /**
- * 数据表主键
- * @var string
- */
- protected $pk = 'id';
- /**
- * 模型名称
- * @var string
- */
- protected $name = 'write_off';
- use ModelTrait;
- /**
- * @param $where
- * @return array
- */
- public static function systemPage($where)
- {
- $model = new self;
- $model = $model->alias('a')
- ->field('a.*,b.nickname,c.coupon_title,c.coupon_price,d.name as d_name')
- ->order('a.id DESC ')
- ->leftJoin('user b', 'b.uid = a.uid')
- ->leftJoin('store_coupon_user c', 'c.id = a.coupon_id')
- ->leftJoin('system_store d', 'd.id = c.store_id');
- if ($where['title'] != '') $model = $model->where('b.uid|b.nickname', 'LIKE', "%$where[title]%");
- // if($where['is_del'] != '') $model = $model->where('is_del',$where['is_del']);
- $list = self::page($model, $where);
- if ($list){
- foreach ($list['list'] as &$v){
- $v['add_time'] = $v['add_time'] > 0 ? date('Y-m-d H:i:s', $v['add_time']) : 0;
- }
- }
- return $list;
- }
- }
|