Commit b8a9a6ab authored by clone's avatar clone

1

parent d324cc71
......@@ -87,13 +87,26 @@ class StoreFee extends Basic
return $this->response("101", "save exception");
}
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getApplyForFeeStore(){
$params = $this->params;
$params = array(
/* $params = array(
"store_id" => 1
);
);*/
$storeModel = new AStore();
$storeModel->getStore();
$field = "a.id,b.office_address";
$office_info = $storeModel->getStoreAndOffice($field,["store_id"=> $params["store_id"]]);
if($office_info){
return $this->response("200", "request success", $office_info);
}else{
return $this->response("101", "null");
}
}
}
\ No newline at end of file
......@@ -348,8 +348,25 @@ class AStore extends BaseModel
return Db::table($this->table)->update($params);
}
public function getStoreAndOffice($params){
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getStoreAndOffice($field,$params){
$where_ = [];
if(isset($params["store_id"])){
$where_["a.id"] = $params["store_id"];
}
return Db::table($this->table)
->field($field)
->alias("a")
->join("f_office b","a.office_id = b.id","left")
->where($where_)
->select();
}
}
\ No newline at end of file
......@@ -999,6 +999,7 @@ Route::group('broker', [
'checkCost' => ['api_broker/ApplyForCost/check', ['method' => 'POST']], //费用报销审核总监
'addApplyFor' => ['api_broker/StoreFee/addApplyFor', ['method' => 'GET']],//新增报销申请
'getApplyForFeeStore' => ['api_broker/StoreFee/getApplyForFeeStore', ['method' => 'GET']],//新增报销申请
]);
Route::group('search', [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment