| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * @package merchant
- *
- * @author xaboy
- * @day 2020-04-16
- *
- *
- */
- namespace app\common\repositories\system\merchant;
- use app\common\dao\system\merchant\MerchantHaikeRefundDao;
- use app\common\model\system\merchant\MerchantHaikeRefund;
- use app\common\repositories\BaseRepository;
- use FormBuilder\Factory\Elm;
- use think\db\exception\DataNotFoundException;
- use think\db\exception\DbException;
- use think\db\exception\ModelNotFoundException;
- use think\facade\Route;
- /**
- * Class MerchantHaikeRefundRepository
- * @package app\common\repositories\system\merchant
- * @author php迷途小书童
- * @created 2021/3/17 9:27
- */
- class MerchantHaikeRefundRepository extends BaseRepository
- {
- /**
- * MerchantRepository constructor.
- * @param MerchantHaikeRefundDao $dao
- */
- public function __construct(MerchantHaikeRefundDao $dao)
- {
- $this->dao = $dao;
- }
- /**
- * @param array $where
- * @param $page
- * @param $limit
- * @return array
- * @throws DataNotFoundException
- * @throws DbException
- * @throws ModelNotFoundException
- * @author xaboy
- * @day 2020-04-16
- */
- public function getList(array $where, $page, $limit)
- {
- $query = $this->dao->search($where);
- $count = $query->count($this->dao->getPk());
- $list = $query->with(['merchant'])
- ->page($page, $limit)
- ->select();
- $query1 = $this->dao->search($where);
- $count1 = MerchantHaikeRefund::getInstance()->where('status', 0)->count();
- $count2 = MerchantHaikeRefund::getInstance()->where('status', 1)->count();
- $count3 = MerchantHaikeRefund::getInstance()->where('status', 2)->count();
- $merdata= [
- ['className'=> 'el-icon-s-order', 'count'=>$count1, 'field'=> '个', 'name'=> '待处理'],
- ['className'=> 'el-icon-s-order', 'count'=>$count2, 'field'=> '个', 'name'=> '已处理'],
- ['className'=> 'el-icon-s-order', 'count'=>$count3, 'field'=> '个', 'name'=> '已出款']
- ];
- return compact('count', 'list','merdata');
- }
- public function changeStatusForm(int $id)
- {
- $form = Elm::createForm(Route::buildUrl('systemMerchantHaikeRefundChangeStatus', ['id' => $id])->build());
- $form->setRule([
- Elm::radio('status', '修改状态', 1)
- ->setOptions([
- ['value' => 0, 'label' => '待处理'],
- ['value' => 1, 'label' => '已处理'],
- ['value' => 2, 'label' => '已出款'],
- ]),
- Elm::input('mark', '备注'),
- ]);
- return $form->setTitle('修改状态');
- }
- }
|