1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- namespace app\admin\model\store;
- use traits\ModelTrait;
- use basic\ModelBasic;
- /**
- * 评论管理 model
- * Class StoreProductReply
- * @package app\admin\model\store
- */
- class StoreProductReply extends ModelBasic
- {
- use ModelTrait;
- /**
- * @param $where
- * @return array
- */
- public static function systemPage($where){
- $model = new self;
- if($where['comment'] != '') $model = $model->where('r.comment','LIKE',"%$where[comment]%");
- if($where['is_reply'] != ''){
- if($where['is_reply'] >= 0){
- $model = $model->where('r.is_reply',$where['is_reply']);
- }else{
- $model = $model->where('r.is_reply','GT',0);
- }
- }
- if($where['product_id']) $model = $model->where('r.product_id',$where['product_id']);
- $model = $model->alias('r')->join('__WECHAT_USER__ u','u.uid=r.uid');
- $model = $model->join('__STORE_PRODUCT__ p','p.id=r.product_id');
- $model = $model->where('r.is_del',0);
- $model = $model->field('r.*,u.nickname,u.headimgurl,p.store_name');
- if(isset($where['mer_id']) && $where['mer_id']) $model->where('p.mer_id',$where['mer_id']);
- return self::page($model,function($itme){
- },$where);
- }
- }
|