Commit d324cc71 authored by clone's avatar clone

1

parent ae31c006
......@@ -6,6 +6,7 @@ use app\api_broker\extend\Basic;
use app\api_broker\service\StoreFeeService;
use app\index\service\UserService;
use app\model\AAgents;
use app\model\AStore;
use app\model\FollowUpLogModel;
/**
......@@ -75,7 +76,7 @@ class StoreFee extends Basic
return $this->response("101", "请上传图片");
}
$if_verify = $this->service_->verifyType($type, $fee_item);
if(!$if_verify){
if (!$if_verify) {
return $this->response("101", "类型选择错误");
}
$is_ok = $this->service_->addApplyFor($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
......@@ -86,61 +87,13 @@ class StoreFee extends Basic
return $this->response("101", "save exception");
}
}
/**
* 获取报备列表
* @return \think\Response
* @throws \think\db\exception\BindParamException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function reportList()
{
public function getApplyForFeeStore(){
$params = $this->params;
/* $params = array(
"agent_id" =>6562,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"is_all"=>0,//0搜索我自己的,1全部
"page_no"=>1,
"page_size"=>15
);*/
$checkResult = $this->validate($params, "StoreFeeValidate.addApplyFor");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,
b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = [];
$agentModel = new AAgents();
$agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
if (isset($params["is_all"]) && $params["is_all"] == 1) {
$check_type = 1;
if ($agents_data["level"] < 30) {
$check_type = $this->service_->getCheckType($this->agentId);
if ($check_type == 0) {
return $this->response(101, "暂无权限");
}
}
$result = $this->service_->orderListAll($field, $params, $pageNo, $pageSize, $check_type);
} else {
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
}
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
return $this->response("200", "request null");
}
$params = array(
"store_id" => 1
);
$storeModel = new AStore();
$storeModel->getStore();
}
}
\ No newline at end of file
......@@ -19,7 +19,6 @@ class StoreFeeValidate extends Validate
'total_fee' => 'require|number',
'agent_id' => 'require|number',
'store_id' => 'require|number',
'assume_fee' => 'require|number',
'site_id' => 'require|number',
];
......@@ -34,14 +33,12 @@ class StoreFeeValidate extends Validate
'agent_id.number' => '申请人只能为数字',
'store_id.require' => '门店不能为空',
'store_id.number' => '状门店只能为数字',
'assume_fee.require' => '费用承担金额不能为空',
'assume_fee.number' => '费用承担金额只能为数字',
'site_id.require' => '站点不能为空',
'site_id.number' => '站点只能为数字',
];
protected $scene = [
'addApplyFor' => ['type', 'fee_item', 'total_fee', 'agent_id', 'store_id', 'assume_fee', 'site_id'],
'addApplyFor' => ['type', 'fee_item', 'total_fee', 'agent_id', 'store_id', 'site_id'],
];
}
\ No newline at end of file
......@@ -347,4 +347,9 @@ class AStore extends BaseModel
{
return Db::table($this->table)->update($params);
}
public function getStoreAndOffice($params){
$where_ = [];
}
}
\ No newline at end of file
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