123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\common\model\Config;
- use app\hander\HelpHander;
- use think\App;
- use think\Db;
- use think\Exception;
- use think\exception\Handle;
- use think\Controller;
- class Third extends Controller {
- //发起订单
- public function add() {
- $this->model = new \app\common\model\Orders();
- $userId = 187;
- $userOrg = Db::name('user_org')
- ->where('user_id',$userId)
- ->find();
- $userDep = Db::name('user_dep')
- ->where('user_id',$userId)
- ->find();
- $json = [
- 'user_id'=>$userId,
- 'org_id'=>$userOrg?$userOrg['org_id']:0,
- 'dep_id'=>$userDep?$userDep['dep_id']:0,
- 'images'=>input('images',''),
- 'videos'=>input('videos',''),
- 'voices'=>input('voices',''),
- 'content'=>input('content',''),
- 'work_type_mode'=>input('workTypeMode/d',1),
- 'repair_priority'=>input('repairPriority',2),
- ];
- if(!in_array($json['work_type_mode'],[1])){
- HelpHander::error('workTypeMode参数值错误');
- }
- $res = $this->model->addSave($json);
- if (!$res) {
- HelpHander::error($this->model->getError());
- }
- HelpHander::success('操作成功');
- }
- }
|