更新
This commit is contained in:
parent
541bfe2f43
commit
9654e2efae
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\logic\task\TaskLogic;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\informationg\UserInformationg;
|
||||
use app\common\model\task\Task;
|
||||
@ -65,14 +66,51 @@ class TaskController extends BaseApiController
|
||||
$company = Company::where('id', $parmas['company_id'])->field('id,deposit,company_money,user_id,day_count,company_type,province,city,area,street,village,brigade')->find(); // 可能要判断预存金是否满足
|
||||
$find = App(RemoteController::class)->shang_date_total_price($company);
|
||||
|
||||
$list = App(RemoteController::class)->shang_date_list($company,1,$parmas);
|
||||
$list = App(RemoteController::class)->shang_date_list($company, 1, $parmas);
|
||||
if ($find != false) {
|
||||
$find['list']=$list;
|
||||
$find['list'] = $list;
|
||||
return $this->success('ok', $find);
|
||||
}
|
||||
return $this->success('ok');
|
||||
}
|
||||
|
||||
/**
|
||||
* 三轮车详情
|
||||
*/
|
||||
public function tricycle_detail()
|
||||
{
|
||||
$parmas = $this->request->param();
|
||||
$task = TaskLogic::detail($parmas);
|
||||
return $this->success('ok', $task);
|
||||
}
|
||||
|
||||
/**
|
||||
* 三轮车坐标
|
||||
*/
|
||||
public function add_tricycle_coordinate()
|
||||
{
|
||||
$parmas = $this->request->param();
|
||||
$task = Task::where('id', $parmas['id'])->find()->toArray();
|
||||
$data['status'] = 2;
|
||||
if (isset($parmas['terminus'])) {
|
||||
$res = App(RemoteController::class)->coordinate($parmas, $parmas['terminus']['lnglat'][0], ['terminus']['lnglat'][1]);
|
||||
$task['extend']['update']['terminus']['lnglat'] = $parmas['terminus'];
|
||||
}
|
||||
if (isset($parmas['transfer'])) {
|
||||
$res = App(RemoteController::class)->coordinate($parmas, $parmas['transfer']['lnglat'][0], ['transfer']['lnglat'][1]);
|
||||
$task['extend']['update']['transfer']['lnglat'] = $parmas['transfer'];
|
||||
}
|
||||
if (isset($task['extend']['update']['terminus']) && isset($task['extend']['update']['transfer'])) {
|
||||
$data['status'] = 3;
|
||||
}
|
||||
if($res<100){
|
||||
$data['extend'] = json_encode($task['extend']);
|
||||
Task::where('id', $parmas['task_id'])->update($data);
|
||||
return $this->success('更新成功');
|
||||
}
|
||||
return $this->fail('定位坐标大于100米,请重新打卡');
|
||||
}
|
||||
|
||||
public function informationg_list()
|
||||
{
|
||||
$parmas = Request()->param();
|
||||
|
Loading…
x
Reference in New Issue
Block a user