StoreProductReply.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\model\store;
  12. use traits\ModelTrait;
  13. use basic\ModelBasic;
  14. /**
  15. * 评论管理 model
  16. * Class StoreProductReply
  17. * @package app\admin\model\store
  18. */
  19. class StoreProductReply extends ModelBasic
  20. {
  21. use ModelTrait;
  22. /**
  23. * @param $where
  24. * @return array
  25. */
  26. public static function systemPage($where){
  27. $model = new self;
  28. if($where['comment'] != '') $model = $model->where('r.comment','LIKE',"%$where[comment]%");
  29. if($where['is_reply'] != ''){
  30. if($where['is_reply'] >= 0){
  31. $model = $model->where('r.is_reply',$where['is_reply']);
  32. }else{
  33. $model = $model->where('r.is_reply','GT',0);
  34. }
  35. }
  36. if($where['product_id']) $model = $model->where('r.product_id',$where['product_id']);
  37. $model = $model->alias('r')->join('__WECHAT_USER__ u','u.uid=r.uid');
  38. $model = $model->join('__STORE_PRODUCT__ p','p.id=r.product_id');
  39. $model = $model->where('r.is_del',0);
  40. $model = $model->field('r.*,u.nickname,u.headimgurl,p.store_name');
  41. if(isset($where['mer_id']) && $where['mer_id']) $model->where('p.mer_id',$where['mer_id']);
  42. return self::page($model,function($itme){
  43. },$where);
  44. }
  45. }