Commit 13a1b47b authored by clone's avatar clone

bug

parent 00d97aac
......@@ -70,14 +70,16 @@ class ConvertOrder extends Basic
foreach ($appliesList as $item) {
$userInfo = $this->userModel->insertUserConvert($this->userBin($item["customer"], $item["customer"],
$item["phpone"], $item["sex"], $item["created"]));
if (count($userInfo) <= 0) continue;
$reportParam = $this->reportBin($item["id"], $item["agent_id"], $item["phone"], $item["realname"], $item["agent_shop_id"], $userInfo["id"], $userInfo["user_phone"]
, $userInfo["user_name"], $item["vehicle"], $item["agent_shop_id"], $item["receptiontime"], $item["created"], $item["modified"]);
$f_id = $this->reportModel->addReport($reportParam);
if ($f_id > 0) {
$orderParam = $this->orderBin($this->createOrderNumber(), $f_id, $item["house_id"]);
array_push($orderArr, $orderParam);
if (count($userInfo) > 1) {
$reportParam = $this->reportBin($item["id"], $item["agent_id"], $item["phone"], $item["realname"], $item["agent_shop_id"], $userInfo["id"], $userInfo["user_phone"]
, $userInfo["user_name"], $item["vehicle"], $item["agent_shop_id"], $item["receptiontime"], $item["created"], $item["modified"]);
$f_id = $this->reportModel->addReport($reportParam);
if ($f_id > 0) {
$orderParam = $this->orderBin($this->createOrderNumber(), $f_id, $item["house_id"],$item["created"], $item["modified"]);
array_push($orderArr, $orderParam);
}
}
}
$this->orderModel->insertOrderByAll($orderArr);
}
......@@ -91,6 +93,7 @@ class ConvertOrder extends Basic
*/
public function convertMarchIn()
{
set_time_limit(0);
$total = $this->remarksModel->getRemarksCount();
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
......@@ -111,9 +114,10 @@ class ConvertOrder extends Basic
public function convertCollectingBill()
{
set_time_limit(0);
$field = "a.type,a.moneytype,a.money,a.trademark,a.remarks,a.created,a.modified,d.id as agent_id,b.id as report_id,c.id as order_id,c.order_no";
$collectingBillList = $this->journalaccountsModel->getJournalAccountsListByStatus(1, 2000, $field);
dump($collectingBillList);
dump($collectingBillList);exit;
$collectingBillArr = [];
foreach ($collectingBillList as $key => $item) {
$collectingBillParams = $this->collectingBillBin(0, $item["moneytype"], $item["type"], $item["money"],
......@@ -269,9 +273,11 @@ class ConvertOrder extends Basic
* @param $order_no
* @param $f_id
* @param $house_id
* @param $create_time
* @param $update_time
* @return mixed
*/
private function orderBin($order_no, $f_id, $house_id)
private function orderBin($order_no, $f_id, $house_id,$create_time,$update_time)
{
$houseModel = new GHouses();
$houseResult = $houseModel->getHouseDetail("id,internal_title", [ "id" => $house_id ]);
......@@ -280,8 +286,8 @@ class ConvertOrder extends Basic
$param["f_id"] = $f_id;
$param["house_id"] = $house_id;
$param["house_title"] = $house_title;
$param["create_time"] = date("Y-m-d H:i:s", time());
$param["update_time"] = date("Y-m-d H:i:s", time());
$param["create_time"] = $create_time;
$param["update_time"] = $update_time;
return $param;
}
......
......@@ -50,6 +50,7 @@ class Basic extends Controller
"api/commentAndDeal",
"api/check_code",
"api/convertOrderByTime",
"api/convertMarchIn",
"api/convertCollectingBill",
);
......@@ -82,7 +83,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
$this->tokenVerify();
}
}
......
......@@ -26,7 +26,7 @@ class Applies extends Model
public function getApplies($pageNo, $pageSize, $field)
{
$where_["transaction_status"] = 1;
$where_["transaction_status"] = 0;
return Db::table($this->table)
->field($field)
->alias("a")
......@@ -39,7 +39,7 @@ class Applies extends Model
}
public function getAppliesCount()
{
$where_["transaction_status"] = 1;
$where_["transaction_status"] = 0;
return $this
->field("a.id")
->alias("a")
......
......@@ -115,8 +115,8 @@ class JournalAccounts extends Model
return $this->db
->field($field)
->alias("a")
->join('o_report b', 'a.apply_id = b.id', 'LEFT')
->join('o_order c', 'b.id = c.f_id', 'LEFT')
->join('o_report b', 'a.apply_id = b.id', 'right')
->join('o_order c', 'b.id = c.f_id', 'right')
->join('agents d', 'a.operaaccount = d.realname', 'LEFT')
->where($params)
->limit($pageSize)
......
......@@ -376,7 +376,8 @@ class Users extends Model
*/
public function insertUserConvert($params){
$where_ = [];
if(!isset($params["user_phone"]) || !preg_match('/^1[345678]\d{9}$/', $params["user_phone"])){
$params["user_phone"] = strlen($params["user_phone"])>11 ? substr($params["user_phone"], 0,11) : $params["user_phone"];
if(!isset($params["user_phone"]) || !preg_match('/^1[3456789]\d{9}$/', $params["user_phone"])){
return null;
}
$where_ ["user_phone"] = $params ["user_phone"];
......
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