| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- /**
- *
- * @author: xaboy<365615158@qq.com>
- * @day: 2017/11/02
- */
- namespace app\admin\model\qa;
- use app\admin\model\store\StoreProduct;
- use app\admin\model\system\SystemAdmin;
- use app\models\user\User;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- /**
- * 图文管理 Model
- * Class WechatNews
- * @package app\admin\model\wechat
- */
- class QaReply extends BaseModel
- {
- use ModelTrait;
- protected $name = 'qa_reply';
- /**
- * 获取回复列表
- * @param array $where
- * @return array
- */
- public static function getAll( $where = [],$id)
- {
- $model = new self;
- // if($where['status'] !== '') $model = $model->where('status',$where['status']);
- // if($where['access'] !== '') $model = $model->where('access',$where['access']);
- if ($where['title'] !== '') $model = $model->where('title', 'LIKE', "%$where[title]%");
- $model = $model->where('is_del', 0)->where('pid',$id)->order('id desc');
- return self::page($model, function ($item) {
- $item['nickname'] = User::where('uid', $item['uid'])->value('nickname');
- }, $where);
- }
- /**
- * 删除问答
- * @param $id
- * @return bool
- */
- public static function del($id)
- {
- return self::edit(['is_del' => 1], $id, 'id');
- }
- public static function changeFail($id)
- {
- return self::edit(['status' => 2], $id, 'id');
- }
- public static function changeSuccess($id)
- {
- return self::edit(['status' => 1], $id, 'id');
- }
- }
|