更新pcb后台

parent 70ffba76
Homestead.yaml
Homestead.json
.env
/.idea
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BladeInjectionConfiguration" escapedTextEnd="!!}" escapedTextStart="{!!" />
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<OptionsSetting value="true" id="添加" />
<OptionsSetting value="true" id="移除" />
<OptionsSetting value="true" id="签出" />
<OptionsSetting value="true" id="更新" />
<OptionsSetting value="true" id="状态" />
<OptionsSetting value="true" id="编辑" />
<ConfirmationsSetting value="0" id="添加" />
<ConfirmationsSetting value="0" id="移除" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Order.iml" filepath="$PROJECT_DIR$/.idea/Order.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -6,6 +6,7 @@ use App\Map\PcbOrderInvoiceMap;
use App\Map\PcbOrderMap;
use App\Map\PcbOrderShippingMap;
use App\Model\PaymentDaysModel;
use App\Model\Pcb\PcbPublicModel;
use Illuminate\Http\Request;
use App\Http\Requests;
......@@ -121,7 +122,8 @@ class WebController extends Controller
$purchase['finish_time'] = $purchase['finish_time'] > 0 ? date('Y-m-d H:i:s',$purchase['finish_time']) : "";
}
//拼接基本信息
$orderBase['order_pay_type'] = PcbOrderMap::$order_pay_type[$orderBase['order_pay_type']];
$PcbPublicModel = new PcbPublicModel();
$orderBase['order_pay_type'] = $PcbPublicModel->getPay($order_id);
$orderBase['order_type'] = PcbOrderMap::$order_type[$orderBase['order_type']];
$orderBase['status_name'] = PcbOrderMap::$status[$orderBase['status']];
$orderBase['create_time'] = $orderBase['create_time'] > 0 ? date('Y-m-d H:i:s',$orderBase['create_time']) : "";
......
......@@ -337,6 +337,12 @@ function export_csv($data = [], $header_data = [], $file_name = '')
fclose($fp);exit;
}
/*
*所有变量转字符串
*/
function changeToStr($str){
return sprintf("'%s'", $str);
}
/*
* 取二维数组某一列的值生成以逗号分隔的字符串,如:$data = ['0'=>['uid'=>'1313','name'=>121],'1'=>['uid'=>'1414','name'=>121]]
转换后变为:arrayTostr($data,'uid') =》1313,1414
* @param array $data 要取值的数组
......
......@@ -72,6 +72,8 @@ class PcbOrderModel extends Model
return [];
}
$PcbPurchaseModel = new PcbPurchaseModel();
$PcbPublicModel = new PcbPublicModel();
$con = DB::connection("pcb");
foreach ($data as $k=>&$v){
//查询采购
$puchase = $PcbPurchaseModel->where("order_id",$v['order_id'])->first();
......@@ -85,8 +87,8 @@ class PcbOrderModel extends Model
$v['purchase_amount'] = $puchase['purchase_amount'] > 0 ? $puchase['purchase_amount'] : "";
$v['purchase_sn'] = $puchase['purchase_sn'];
}
$v['order_pay_type'] = PcbOrderMap::$order_pay_type[$v['order_pay_type']];
//查询支付
$v['order_pay_type'] = $PcbPublicModel->getPay($v['order_id']);
$v['order_type'] = PcbOrderMap::$order_type[$v['order_type']];
$v['status_name'] = PcbOrderMap::$status[$v['status']];
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
......
......@@ -2,6 +2,7 @@
namespace App\Model\Pcb;
use App\Map\PcbOrderMap;
use League\Flysystem\Exception;
use Request;
use DB;
......@@ -84,5 +85,19 @@ class PcbPublicModel
return [10002, '失败'.$e->getMessage()];
}
}
/*
* 查询支付方式
*/
public function getPay($order_id){
$payLog = DB::connection("pcb")->table("pay_log")->where(['is_paid'=>1,'order_id'=>$order_id])->get();
$payName = "";
if ($payLog){
$payLog = objectToArray($payLog);
$payName = arrayToCommaStr($payLog,'pay_name',2);
}
return $payName;
}
}
\ 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 sign in to comment