Commit d2d085e7 authored by zhuwei's avatar zhuwei

未提交财务日报的门店

parent 5478019e
...@@ -127,10 +127,7 @@ class CollectHouse extends Basic ...@@ -127,10 +127,7 @@ class CollectHouse extends Basic
$get_params['agents_id'] = $params["agents_id"]; $get_params['agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1; $get_params['CollectUser.status'] = 1;
if (isset($params['site_name']) && $params['site_name']) {
//城市筛选
$get_params['Houses.city'] = $params['site_name'];
}
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params); $res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectHouse->getCollectListTotal($field,$get_params); $res_total = $this->aCollectHouse->getCollectListTotal($field,$get_params);
......
...@@ -180,10 +180,8 @@ class ImageDepot extends Basic ...@@ -180,10 +180,8 @@ class ImageDepot extends Basic
public function ceshi() public function ceshi()
{ {
header('Content-Type:text/json;charset=utf-8');
echo json_encode(['name'=>'xiaom','name'=>'xiaom2']);
$header = $this->request->header();
dump($header["x-forwarded-for"]);
} }
......
...@@ -481,4 +481,18 @@ class AStore extends BaseModel ...@@ -481,4 +481,18 @@ class AStore extends BaseModel
// big_log($this->getLastSql()); // big_log($this->getLastSql());
return $result; return $result;
} }
public function getDailyUncommittedId($time)
{
$sql = "SELECT
*
FROM
( ( SELECT id AS store_id FROM a_store ) UNION ALL ( SELECT store_id FROM o_daily WHERE daily_date = '{$time}' ) ) c
GROUP BY
store_id
HAVING
count( store_id ) = 1 ";
$result = Db::table($this->table)->query($sql);
return $result;
}
} }
\ No newline at end of file
...@@ -84,7 +84,6 @@ class ODailyUncommittedModel extends Model ...@@ -84,7 +84,6 @@ class ODailyUncommittedModel extends Model
$result = $this->db_ ->where($where)->update($params); $result = $this->db_ ->where($where)->update($params);
//dump($this->getLastSql()); //dump($this->getLastSql());
return $result; return $result;
} }
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace app\task\controller; namespace app\task\controller;
use app\api_broker\service\PushMessageService; use app\api_broker\service\PushMessageService;
use app\model\AStore;
use app\model\ODailyUncommittedModel; use app\model\ODailyUncommittedModel;
...@@ -30,31 +31,20 @@ class DailyUncommittedTask ...@@ -30,31 +31,20 @@ class DailyUncommittedTask
{ {
$time = date("Y-m-d"); $time = date("Y-m-d");
$s_push_msg = new PushMessageService(); $s_push_msg = new PushMessageService();
$m_store = new AStore();
//未提交日报门店集合 //未提交日报门店集合
$sql = "SELECT $id_str = $this->getDailyUncommittedId($time);
`a`.`id`, if(!$id_str){
`a`.`district_id`, return '无数据';
b.id AS agent_id, }
`b`.`name` $params_select=[];
FROM $params_select['a.id'] = array('in',$id_str);
`a_store` `a` $store_result = $m_store->selectDailyUncommitted('a.id,a.district_id,b.id as agent_id,b.name', $params_select);
LEFT JOIN `a_agents` `b` ON `a`.`id` = b.store_id
AND ( b.LEVEL = 20 OR b.LEVEL = 40 )
WHERE
`a`.`status` = 0
AND `a`.`id` IN (
SELECT
*
FROM
( ( SELECT id AS store_id FROM a_store ) UNION ALL ( SELECT store_id FROM o_daily WHERE daily_date = '{$time}' ) ) c
GROUP BY
store_id
HAVING
count( store_id ) = 1
)";
$store_result = $this->m_daily_uncommitted->query($sql);
if(!$store_result){
return '无数据';
}
foreach ($store_result as $k => $v) { foreach ($store_result as $k => $v) {
if(!$v['agent_id']){ if(!$v['agent_id']){
continue; continue;
...@@ -85,6 +75,19 @@ class DailyUncommittedTask ...@@ -85,6 +75,19 @@ class DailyUncommittedTask
return "成功"; return "成功";
} }
public function getDailyUncommittedId($time)
{
$m_store = new AStore();
$res = $m_store->getDailyUncommittedId($time);
$id_str = "";
if (count($res) > 0) {
foreach ($res as $k => $v) {
$id_str .= $v["store_id"]. ",";
}
$id_str = rtrim($id_str, ",");
}
return $id_str;
}
/** /**
* 新增 * 新增
......
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