您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

543 行
27 KiB

  1. <?php
  2. /*
  3. * wechat 2.0
  4. * Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
  5. * Date: 2016.7.12
  6. * Something is to pay QQ1062140302
  7. */
  8. require_once './Mysql.php';
  9. /**
  10. * @param type $user_id 下单用户id
  11. * @param type $playdate 游玩日期
  12. * @param type $create_time 订单创建时间
  13. * @param type $customer_name 顾客姓名
  14. * @param type $customer_phone 顾客电话
  15. * @param type $customer_id_type id类型 150身份证 153 护照
  16. * @param type $customer_id 顾客id号
  17. * @param type $ticket 订票类型 $ticket=array(
  18. 'D'=>0,//成人票
  19. 'C'=>0,//儿童票
  20. 'O'=>0,//老人票
  21. 'D2'=>0,//成人两日票
  22. 'C2'=>0,//儿童两日票
  23. 'O2'=>0,//老人两日票
  24. );
  25. * @param type $return_no 外部订单号
  26. * @param $order_from_org_id 订单对应组织id
  27. */
  28. //addtheater('998', '111', '2122','111', '1111', '22222', '222', '2222', array( 'AA'=>1,'AB'=>1, 'BB'=>0, 'BA'=>0, 'CA'=>0,'CB'=>0), 1111,'0');
  29. //adddisney('998', '111', '2122', '1111', '22222', '222', '2222', array('D'=>1,'C'=>0,'O'=>0,'D2'=>1,'C2'=>0,'O2'=>0), 1111,'0');
  30. function adddisney($user_id,$playdate,$create_time,$customer_name,$customer_phone,$customer_id_type,$customer_id,$ticket,$return_no,$order_from_org_id){
  31. $date =isset($playdate)?$playdate:'0';
  32. $cust_name = isset($customer_name)?$customer_name:'匿名';
  33. $cust_phone = isset($customer_phone)?$customer_phone:'0';
  34. $id_type = isset($customer_id_type)? $customer_id_type:'150'; // 150身份证 153 护照
  35. $customer_id = isset($customer_id)?$customer_id:'0';
  36. $return_no = isset($return_no)? $return_no:'0';
  37. $order_status =146;
  38. $pay_type_id_1 = 275;
  39. $pdo = conn();
  40. $sql = "select a.prod_id,a.prod_name,b.prod_price,b.prod_type_id "
  41. . "from opera_product a inner join opera_product_price b on a.prod_id = b.prod_id "
  42. . "where a.parent_id = 387267";
  43. $result=$pdo->query($sql);
  44. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  45. $info = array();
  46. foreach ($rowset as $v) {
  47. $info[$v['prod_id']] = $v;
  48. }
  49. $sql_p = "select prod_id,prod_name "
  50. . " from opera_product "
  51. . " where prod_id = 387267";
  52. $result_p=$pdo->query($sql_p);
  53. $rowset_p = $result_p -> fetchAll(PDO::FETCH_ASSOC);
  54. $info_p = $rowset_p[0];
  55. $num=0;
  56. $order_description = "";
  57. $price=0;
  58. foreach ($ticket as $k=>$v) {
  59. $num+=$v;
  60. if($v){
  61. switch ($k){
  62. case 'D':
  63. $price+=$info['387538']['prod_price']*$v;
  64. $order_description.=" 标准一日票,". date('Y-m-d',time()).",".$v."|";
  65. break;
  66. case 'C':
  67. $price+=$info['387540']['prod_price']*$v;
  68. $order_description.="儿童一日票,". date('Y-m-d',time()).",".$v."|";
  69. break;
  70. case 'O':
  71. $price+=$info['387539']['prod_price']*$v;
  72. $order_description.="老人一日票,". date('Y-m-d',time()).",".$v."|";
  73. break;
  74. case 'C2':
  75. $price+=$info['387543']['prod_price']*$v;
  76. $order_description.="儿童两日票,". date('Y-m-d',time()).",".$v."|";
  77. break;
  78. case 'D2':
  79. $price+=$info['387541']['prod_price']*$v;
  80. $order_description.="标准两日票,". date('Y-m-d',time()).",".$v."|";
  81. break;
  82. case 'O2':
  83. $price+=$info['387542']['prod_price']*$v;
  84. $order_description.="老人两日票,". date('Y-m-d',time()).",".$v."|";
  85. break;
  86. }
  87. }
  88. }
  89. $id_p = getUniqeId();
  90. $order_id_p = $id_p;
  91. $pay_main_id = getUniqeId();
  92. $create_time;
  93. $update_time = $create_time;
  94. $order_pay_status = 0;
  95. //查找数据库中关于迪士尼的信息
  96. $sql_in=" insert into order_main
  97. (`id`,
  98. `order_id`,
  99. `create_time`,`update_time`,
  100. `order_pay_status`,`order_description`,
  101. `order_price`,`order_prod_type`,`prod_name`,`order_status`,
  102. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  103. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`prod_id`,`run_date`,`main_create_user_id`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`)
  104. values ('".$id_p."','"
  105. .$order_id_p."',
  106. '".$create_time."','".$update_time."','0','".$order_description."','"
  107. .$price."','258','".$info_p['prod_name']."','".$order_status."','
  108. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."','0','0','".$info_p['prod_id']."','".$date."','".$user_id."','".$pay_main_id."','".$order_from_org_id."','".$return_no."')";
  109. for_insert($sql_in);
  110. //插入支付方式等信息
  111. $sql_pay="insert INTO"
  112. . " `order_pay_main`(id,CREATe_user_id,CREATE_time,update_user_id,pay_total) "
  113. . "VALUES(".$pay_main_id.",".$user_id.",'".date('Y-m-d H-i-s', time())."',".$user_id.",".$price.");"
  114. . "insert INTO `order_pay_detail`
  115. (id,CREATe_user_id,CREATE_time,update_user_id,pay_main_id,pay_type_id_1,pay_money)
  116. VALUES(".$pay_main_id.",".$user_id.",'".date('Y-m-d H-i-s', time())."',".$user_id.",".$pay_main_id.",'".$pay_type_id_1."',".$price.");";
  117. for_insert($sql_pay);
  118. foreach ($ticket as $k => $v) {
  119. if($v){
  120. switch ($k){
  121. case 'D':
  122. for($i=1;$i<=$v;$i++){
  123. $id =$order_id =getUniqeId();
  124. $sql = " insert into order_main
  125. (`id`,
  126. `order_id`,
  127. `create_time`,`update_time`,
  128. `order_pay_status`,
  129. `order_prod_type`,`order_status`,
  130. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  131. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  132. values ('".$id."','"
  133. .$order_id."',
  134. '".$create_time."','".$update_time."',
  135. '0','258','".$order_status."','
  136. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  137. '0','0','".$id_p."','".$info['387538']['prod_id']."','".$info_p['prod_id']."','".$info['387538']['prod_name']."','".$info_p['prod_name']."','".$info['387538']['prod_price']."','".$date."','".$pay_main_id."','".$order_from_org_id."','".$return_no."','".$user_id."')";
  138. for_insert($sql);
  139. }
  140. break;
  141. case 'C':
  142. for($i=1;$i<=$v;$i++){
  143. $id =$order_id =getUniqeId();
  144. $sql = " insert into order_main
  145. (`id`,
  146. `order_id`,
  147. `create_time`,`update_time`,
  148. `order_pay_status`,
  149. `order_prod_type`,`order_status`,
  150. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  151. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  152. values ('".$id."','"
  153. .$order_id."',
  154. '".$create_time."','".$update_time."',
  155. '0','258','".$order_status."','
  156. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  157. '0','0','".$id_p."','".$info['387540']['prod_id']."','".$info_p['prod_id']."','".$info['387540']['prod_name']."','".$info_p['prod_name']."','".$info['387540']['prod_price']."','".$date."','".$pay_main_id."','".$order_from_org_id."','".$return_no."','".$user_id."')";
  158. for_insert($sql);
  159. }
  160. break;
  161. case 'O':
  162. for($i=1;$i<=$v;$i++){
  163. $id =$order_id =getUniqeId();
  164. $sql = " insert into order_main
  165. (`id`,
  166. `order_id`,
  167. `create_time`,`update_time`,
  168. `order_pay_status`,
  169. `order_prod_type`,`order_status`,
  170. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  171. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  172. values ('".$id."','"
  173. .$order_id."',
  174. '".$create_time."','".$update_time."',
  175. '0','258','".$order_status."','
  176. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  177. '0','0','".$id_p."','".$info['387539']['prod_id']."','".$info_p['prod_id']."','".$info['387539']['prod_name']."','".$info_p['prod_name']."','".$info['387539']['prod_price']."','".$date."','".$pay_main_id."','".$order_from_org_id."','".$return_no."','".$user_id."')";
  178. for_insert($sql);
  179. }
  180. break;
  181. case 'C2':
  182. for($i=1;$i<=$v;$i++){
  183. $id =$order_id =getUniqeId();
  184. $sql = " insert into order_main
  185. (`id`,
  186. `order_id`,
  187. `create_time`,`update_time`,
  188. `order_pay_status`,
  189. `order_prod_type`,`order_status`,
  190. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  191. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  192. values ('".$id."','"
  193. .$order_id."',
  194. '".$create_time."','".$update_time."',
  195. '0','258','".$order_status."','
  196. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  197. '0','0','".$id_p."','".$info['387543']['prod_id']."','".$info_p['prod_id']."','".$info['387543']['prod_name']."','".$info_p['prod_name']."','".$info['387543']['prod_price']."','".$date."','".$pay_main_id."','".$order_from_org_id."','".$return_no."','".$user_id."')";
  198. for_insert($sql);
  199. }
  200. break;
  201. case 'D2':
  202. for($i=1;$i<=$v;$i++){
  203. $id =$order_id =getUniqeId();
  204. $sql = " insert into order_main
  205. (`id`,
  206. `order_id`,
  207. `create_time`,`update_time`,
  208. `order_pay_status`,
  209. `order_prod_type`,`order_status`,
  210. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  211. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  212. values ('".$id."','"
  213. .$order_id."',
  214. '".$create_time."','".$update_time."',
  215. '0','258','".$order_status."','
  216. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  217. '0','0','".$id_p."','".$info['387541']['prod_id']."','".$info_p['prod_id']."','".$info['387541']['prod_name']."','".$info_p['prod_name']."','".$info['387541']['prod_price']."','".$date."','".$pay_main_id."','".$order_from_org_id."','".$return_no."','".$user_id."')";
  218. for_insert($sql);
  219. }
  220. break;
  221. case 'O2':
  222. for($i=1;$i<=$v;$i++){
  223. $id =$order_id =getUniqeId();
  224. $sql = " insert into order_main
  225. (`id`,
  226. `order_id`,
  227. `create_time`,`update_time`,
  228. `order_pay_status`,
  229. `order_prod_type`,`order_status`,
  230. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  231. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  232. values ('".$id."','"
  233. .$order_id."',
  234. '".$create_time."','".$update_time."',
  235. '0','258','".$order_status."','
  236. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  237. '0','0','".$id_p."','".$info['387542']['prod_id']."','".$info_p['prod_id']."','".$info['387542']['prod_name']."','".$info_p['prod_name']."','".$info['387542']['prod_price']."','".$date."','".$pay_main_id."','".$order_from_org_id."','".$return_no."','".$user_id."')";
  238. for_insert($sql);
  239. }
  240. break;
  241. }
  242. }
  243. }
  244. }
  245. /**
  246. *
  247. * @param type $user_id 下单用户id
  248. * @param type $playdate 游玩日期
  249. * @param type $playtime 开场时间
  250. * @param type $create_time 订单创建时间
  251. * @param type $customer_name 顾客姓名
  252. * @param type $customer_phone 顾客电话
  253. * @param type $customer_id_type id类型 150身份证 153 护照
  254. * @param type $customer_id 顾客id号
  255. * @param type $ticket 订票类型 $ticket=array(
  256. 'AA'=>0,
  257. 'AB'=>0,
  258. 'BB'=>0,
  259. 'BA'=>0,
  260. 'CA'=>0,
  261. 'CB'=>0,
  262. );
  263. * @param type $return_no 外部订单号
  264. * @param $order_from_org_id 订单对应组织id
  265. *
  266. */
  267. function addtheater($user_id,$playdate,$playtime,$create_time,$customer_name,$customer_phone,$customer_id_type,$customer_id,$ticket,$return_no,$order_from_org_id){
  268. $date = $playdate;
  269. $time = $playtime;
  270. $cust_name = $customer_name;
  271. $cust_phone =$customer_phone;
  272. $id_type =$customer_id_type; // 150身份证 153 护照
  273. $customer_id = $customer_id;
  274. // $ticket=array(
  275. // 'AA'=>isset($_POST['AA'])?$_POST['AA']:0,
  276. // 'AB'=>isset($_POST['AB'])?$_POST['AB']:0,
  277. // 'BB'=>isset($_POST['BB'])?$_POST['BB']:0,
  278. // 'BA'=>isset($_POST['BA'])?$_POST['BA']:0,
  279. // 'CA'=>isset($_POST['CA'])?$_POST['CA']:0,
  280. // 'CB'=>isset($_POST['CB'])?$_POST['CB']:0,
  281. // );
  282. $tic_buy =$return_no;
  283. $pdo = conn();
  284. $sql = "select a.prod_id,a.prod_name,b.prod_price,b.prod_type_id "
  285. . "from opera_product a inner join opera_product_price b on a.prod_id = b.prod_id "
  286. . "where a.parent_id = 387544";
  287. $result=$pdo->query($sql);
  288. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  289. $info = array();
  290. foreach ($rowset as $v) {
  291. $info[$v['prod_id']] = $v;
  292. }
  293. $sql_p = "select prod_id,prod_name "
  294. . " from opera_product "
  295. . " where prod_id = 387544";
  296. $result_p=$pdo->query($sql_p);
  297. $rowset_p = $result_p -> fetchAll(PDO::FETCH_ASSOC);
  298. $info_p = $rowset_p[0];
  299. $num=0;
  300. $order_description = "";
  301. $price=0;
  302. $return_info='';
  303. //var_dump($info);die;
  304. foreach ($ticket as $k=>$v) {
  305. $num+=$v;
  306. if($v){
  307. switch ($k){
  308. case 'AA':
  309. $price+=$info['387545']['prod_price']*$v;
  310. $return_info.=' AA区 × '.$v;
  311. $order_description.="迪士尼剧场AA区,". date('Y-m-d',time()).",".$v."|";
  312. break;
  313. case 'AB':
  314. $price+=$info['387546']['prod_price']*$v;
  315. $return_info.=' AB区 × '.$v;
  316. $order_description.="迪士尼剧场AB区,". date('Y-m-d',time()).",".$v."|";
  317. break;
  318. case 'BB':
  319. $price+=$info['387547']['prod_price']*$v;
  320. $return_info.=' BB区 × '.$v;
  321. $order_description.="迪士尼剧场BB区,". date('Y-m-d',time()).",".$v."|";
  322. break;
  323. case 'BA':
  324. $price+=$info['387548']['prod_price']*$v;
  325. $return_info.=' BA区 × '.$v;
  326. $order_description.="迪士尼剧场BA区,". date('Y-m-d',time()).",".$v."|";
  327. break;
  328. case 'CA':
  329. $price+=$info['387549']['prod_price']*$v;
  330. $return_info.=' CA区 × '.$v;
  331. $order_description.="迪士尼剧场CA区,". date('Y-m-d',time()).",".$v."|";
  332. break;
  333. case 'CB':
  334. $price+=$info['387550']['prod_price']*$v;
  335. $return_info.=' CB区 × '.$v;
  336. $order_description.="迪士尼剧场CB区,". date('Y-m-d',time()).",".$v."|";
  337. break;
  338. }
  339. }
  340. }
  341. $pay_status =146;
  342. $pay_type_id_1 = 275;
  343. $id_p = $order_id_p = getUniqeId();
  344. $pay_main_id = getUniqeId();
  345. $update_time =$create_time;
  346. $order_pay_status = 0;
  347. //查找数据库中关于迪士尼的信息
  348. $sql_in=" insert into order_main
  349. (`id`,
  350. `order_id`,
  351. `create_time`,`update_time`,
  352. `order_pay_status`,`order_description`,
  353. `order_price`,`order_prod_type`,`prod_name`,`order_status`,
  354. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  355. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`prod_id`,`run_date`,`run_time`,`main_create_user_id`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`)
  356. values ('".$id_p."','"
  357. .$order_id_p."',
  358. '".$create_time."','".$update_time."','0','".$order_description."','"
  359. .$price."','259','".$info_p['prod_name']."','".$pay_status."','
  360. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."','1','0','".$info_p['prod_id']."','".$date."','".$time."','".$user_id."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."')";
  361. for_insert($sql_in);
  362. $sql_pay="insert INTO"
  363. . " `order_pay_main`(id,CREATe_user_id,CREATE_time,update_user_id,pay_total) "
  364. . "VALUES(".$pay_main_id.",".$user_id.",'".date('Y-m-d H-i-s', time())."',".$user_id.",".$price.");"
  365. . "insert INTO `order_pay_detail`
  366. (id,CREATe_user_id,CREATE_time,update_user_id,pay_main_id,pay_type_id_1,pay_money)
  367. VALUES(".$pay_main_id.",".$user_id.",'".date('Y-m-d H-i-s', time())."',".$user_id.",".$pay_main_id.",".$pay_type_id_1.",".$price.");";
  368. for_insert($sql_pay);
  369. foreach ($ticket as $k => $v) {
  370. if($v){
  371. switch ($k){
  372. case 'AA':
  373. for($i=1;$i<=$v;$i++){
  374. $id =$order_id =getUniqeId();
  375. $sql = " insert into order_main
  376. (`id`,
  377. `order_id`,
  378. `create_time`,`update_time`,
  379. `order_pay_status`,
  380. `order_prod_type`,`order_status`,
  381. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  382. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`run_time`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  383. values ('".$id."','"
  384. .$order_id."',
  385. '".$create_time."','".$update_time."',
  386. '0','259','".$pay_status."','
  387. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  388. '0','0','".$id_p."','".$info['387545']['prod_id']."','".$info_p['prod_id']."','".$info['387545']['prod_name']."','".$info_p['prod_name']."','".$info['387545']['prod_price']."','".$date."','".$time."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."','".$user_id."')";
  389. for_insert($sql);
  390. }
  391. break;
  392. case 'AB':
  393. for($i=1;$i<=$v;$i++){
  394. $id =$order_id =getUniqeId();
  395. $sql = " insert into order_main
  396. (`id`,
  397. `order_id`,
  398. `create_time`,`update_time`,
  399. `order_pay_status`,
  400. `order_prod_type`,`order_status`,
  401. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  402. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`run_time`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  403. values ('".$id."','"
  404. .$order_id."',
  405. '".$create_time."','".$update_time."',
  406. '0','259','".$pay_status."','
  407. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  408. '0','0','".$id_p."','".$info['387546']['prod_id']."','".$info_p['prod_id']."','".$info['387546']['prod_name']."','".$info_p['prod_name']."','".$info['387546']['prod_price']."','".$date."','".$time."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."','".$user_id."')";
  409. for_insert($sql);
  410. }
  411. break;
  412. case 'BB':
  413. for($i=1;$i<=$v;$i++){
  414. $id =$order_id =getUniqeId();
  415. $sql = " insert into order_main
  416. (`id`,
  417. `order_id`,
  418. `create_time`,`update_time`,
  419. `order_pay_status`,
  420. `order_prod_type`,`order_status`,
  421. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  422. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`run_time`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  423. values ('".$id."','"
  424. .$order_id."',
  425. '".$create_time."','".$update_time."',
  426. '0','259','".$pay_status."','
  427. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  428. '0','0','".$id_p."','".$info['387547']['prod_id']."','".$info_p['prod_id']."','".$info['387547']['prod_name']."','".$info_p['prod_name']."','".$info['387547']['prod_price']."','".$date."','".$time."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."','".$user_id."')";
  429. for_insert($sql);
  430. }
  431. break;
  432. case 'BA':
  433. for($i=1;$i<=$v;$i++){
  434. $id =$order_id =getUniqeId();
  435. $sql = " insert into order_main
  436. (`id`,
  437. `order_id`,
  438. `create_time`,`update_time`,
  439. `order_pay_status`,
  440. `order_prod_type`,`order_status`,
  441. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  442. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`run_time`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  443. values ('".$id."','"
  444. .$order_id."',
  445. '".$create_time."','".$update_time."',
  446. '0','259','".$pay_status."','
  447. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  448. '0','0','".$id_p."','".$info['387548']['prod_id']."','".$info_p['prod_id']."','".$info['387548']['prod_name']."','".$info_p['prod_name']."','".$info['387548']['prod_price']."','".$date."','".$time."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."','".$user_id."')";
  449. for_insert($sql);
  450. }
  451. break;
  452. case 'CA':
  453. for($i=1;$i<=$v;$i++){
  454. $id =$order_id =getUniqeId();
  455. $sql = " insert into order_main
  456. (`id`,
  457. `order_id`,
  458. `create_time`,`update_time`,
  459. `order_pay_status`,
  460. `order_prod_type`,`order_status`,
  461. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  462. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`run_time`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  463. values ('".$id."','"
  464. .$order_id."',
  465. '".$create_time."','".$update_time."',
  466. '0','259','".$pay_status."','
  467. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  468. '0','0','".$id_p."','".$info['387549']['prod_id']."','".$info_p['prod_id']."','".$info['387549']['prod_name']."','".$info_p['prod_name']."','".$info['387549']['prod_price']."','".$date."','".$time."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."','".$user_id."')";
  469. for_insert($sql);
  470. }
  471. break;
  472. case 'CB':
  473. for($i=1;$i<=$v;$i++){
  474. $id =$order_id =getUniqeId();
  475. $sql = " insert into order_main
  476. (`id`,
  477. `order_id`,
  478. `create_time`,`update_time`,
  479. `order_pay_status`,
  480. `order_prod_type`,`order_status`,
  481. `customer_name`,`customer_mobile`,`customer_id_type`,`customer_id_no`,
  482. `order_book_status`,`PROD_START_STATION_TIME_MINUTES`,`parent_order_id`,`prod_id`,`parent_prod_id`,`prod_name`,`parent_prod_name`,`order_price`,`run_date`,`run_time`,`order_pay_main_id`,`outside_sale_org_id`,`outside_order_no`,`main_create_user_id`)
  483. values ('".$id."','"
  484. .$order_id."',
  485. '".$create_time."','".$update_time."',
  486. '0','259','".$pay_status."','
  487. ".$cust_name."','".$cust_phone."','".$id_type."','".$customer_id."',
  488. '0','0','".$id_p."','".$info['387550']['prod_id']."','".$info_p['prod_id']."','".$info['387550']['prod_name']."','".$info_p['prod_name']."','".$info['387550']['prod_price']."','".$date."','".$time."','".$pay_main_id."','".$order_from_org_id."','".$tic_buy."','".$user_id."')";
  489. for_insert($sql);
  490. }
  491. break;
  492. }
  493. }}
  494. }
  495. function for_insert($sql){
  496. $pdo = conn();
  497. $re = $pdo->exec($sql);
  498. if($re==0){
  499. echo $sql;
  500. exit ;
  501. }
  502. }