123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\App;
- use think\Db;
- use think\exception\Handle;
- class OrderDelay extends Base
- {
- //延迟原因
- public function reasons(){
- $delay_reasons = Db::name('delay_reason')
- ->where('org_id', $this->orgId)
- ->where('enable', 1)
- ->where('del', 0)
- ->select();
- HelpHander::success($delay_reasons?$delay_reasons:[]);
- }
- //申请延迟
- public function add(){
- $id = input('id/d',0);
- if($id <= 0){
- HelpHander::error('参数错误');
- }
- $delay_reason_id = input('delay_reason_id/d',0);
- if (empty($delay_reason_id)) {
- HelpHander::error('请选择延迟原因');
- }
- $res = model("Orders")->delay_reason($id, $delay_reason_id,1);
- if (!$res) {
- HelpHander::error(model("Orders")->getError());
- }
- HelpHander::success('操作成功');
- }
- // 取消延时
- public function cancel(){
- $id = input('id/d',0);
- if($id <= 0){
- HelpHander::error('参数错误');
- }
- $res = model("Orders")->batchcanceldelay($id);
- if (!$res) {
- HelpHander::error(model("Orders")->getError());
- }
- HelpHander::success('操作成功');
- }
- }
|