| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?php
- namespace app\admin\controller\box;
- use app\admin\model\SystemAdmin;
- use app\common\model\BoxModel;
- use app\common\model\BoxRecordModel;
- use app\common\model\CouponAreaModel;
- use app\common\model\CouponPlanModel;
- use app\common\model\ShopCategory;
- use app\admin\traits\Curd;
- use app\common\controller\AdminController;
- use app\common\model\ThirddataLogModel;
- use app\common\model\ThirddataModel;
- use EasyAdmin\annotation\ControllerAnnotation;
- use EasyAdmin\annotation\NodeAnotation;
- use think\App;
- use think\facade\Db;
- use think\Model;
- /**
- * Class Admin
- * @package app\admin\controller\system
- * @ControllerAnnotation(title="魔盒")
- */
- class AppointList extends AdminController
- {
- public function __construct(App $app)
- {
- parent::__construct($app);
- $this->model = new BoxRecordModel();
- }
- use Curd;
- // protected $allowModifyFields = [
- // 'can_buy',
- // 'status'
- // ];
- /**
- * @NodeAnotation(title="预约记录")
- */
- public function index ()
- {
- if ($this->request->isAjax()) {
- if (input('selectFields')) {
- return $this->selectList();
- }
- list($page, $limit, $where) = $this->buildTableParames();
- $count = $this->model
- ->where($where)
- ->count();
- // return 11;
- // return json_decode('[{"price":10, "fee":1},{"price":50, "fee":0.5},{"price":100, "fee":0}]');
- $list = $this->model
- // ->alias('r')
- // ->leftJoin('box b', 'u.id = o.user_id')
- ->withJoin('user', 'LEFT')
- // ->withJoin('box', 'LEFT')
- // ->withAttr('buy_time', function ($val, $data){
- // if (!$val){return '还未配置时间';}
- // $curdata = json_decode($val);
- // $cu_data['day'] = sr_getcurtime($curdata->day, 'Y-m-d');
- //
- // $arr_time = $curdata->time;
- // for ($i = 0; $i < count($arr_time); $i++){
- // $val1 = $curdata->time[$i];
- // $key = 'time'.($i+1);
- // $cu_data[$key] = (sr_getcurtime($val1->start_time, 'H:i:s') . ' - ' . sr_getcurtime($val1->end_time, 'H:i:s'));
- // }
- //
- // return ($cu_data['day']. '日'. ($cu_data['time1']?('【'.$cu_data['time1'].'】'):'' ). '|'. (isset($cu_data['time2'])?('【'.$cu_data['time2'].'】'):''). '|' .(isset($cu_data['time3'])?('【'.$cu_data['time3'].'】'):''));
- // })
- ->withAttr('box_img', function($val, $data){
- return getWebUrl().'/'.$val;
- })
- ->where($where)
- ->page($page, $limit)
- ->order($this->sort)
- ->select();
- $data = [
- 'code' => 0,
- 'msg' => '',
- 'count' => $count,
- 'data' => $list,
- ];
- return json($data);
- }
- return $this->fetch();
- }
- }
|