Consult.php 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  1. <?php
  2. namespace app\admin\controller;
  3. use think\App;
  4. use think\facade\Db;
  5. class Consult extends Base
  6. {
  7. public function __construct(App $app)
  8. {
  9. parent::__construct($app);
  10. }
  11. // public function list(){
  12. // $page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) :"1";
  13. // $size = isset($this->post['size']) && $this->post['size'] !== "" ? intval($this->post['size']) :"10";
  14. // $where=[['is_del',"=",0],["cat_id","<>",0]];
  15. // $zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
  16. // if ($zxNo !== "") {
  17. // $where[] = ['zxNo','=',$zxNo];
  18. // }
  19. // $sequenceNo = isset($this->post['sequenceNo']) && $this->post['sequenceNo'] !== "" ? trim($this->post['sequenceNo']) : "";
  20. // if ($sequenceNo !== "") {
  21. // $where[] = ['sequenceNo','like',"%$sequenceNo%"];
  22. // }
  23. // $salesman = isset($this->post['salesman']) && $this->post['salesman'] !== "" ? trim($this->post['salesman']) : "";
  24. // if ($salesman !== "") {
  25. // //$where["salesman"] =Db::Raw("like '%$salesman%'");
  26. // $where[]= ["salesman",'like',"%$salesman%"];
  27. // }
  28. // $cpName = isset($this->post['cpName']) && $this->post['cpName'] !== "" ? trim($this->post['cpName']) : "";
  29. // if ($cpName !== "") {
  30. // //$where["cpName"]= Db::Raw("like '%$cpName%'");
  31. // $where[]= ["cpName",'like',"%$cpName%"];
  32. // }
  33. // $khNo = isset($this->post['khNo']) && $this->post['khNo'] !== "" ? trim($this->post['khNo']) : "";
  34. // if ($khNo !== "") {
  35. // // $where['khNo'] = $khNo;
  36. // $where[]= ["khNo",'like',"%$khNo%"];
  37. // }
  38. // $start= isset($this->post['start']) && $this->post['start'] !== "" ? $this->post['start']:"";
  39. // if ($start !="") {
  40. // //$where = ["zxtime"=>Db::raw(">= '{$start}'")];
  41. // $where[]= ["zxtime",'>=',$start];
  42. // }
  43. // $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] :"";
  44. // if($end !=""){
  45. // $where[]= ["zxtime",'<=',$end];
  46. // }
  47. // $status = isset($this->post['status']) && $this->post['status'] !== "" ? trim($this->post['status']) : "";
  48. // if ($status !== "") {
  49. // $where[]= ["status",'=',$status];
  50. // }
  51. // $count = Db::name('consult')->where($where)->count();
  52. // $total = ceil($count / $size);
  53. // $page = $page >= $total ? $total : $page;
  54. // $list = Db::name('consult')->where($where)->page($page,$size)
  55. // ->select();
  56. // $data=[];
  57. // foreach ($list as $value){
  58. // $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
  59. // $data[]=$value;
  60. // }
  61. // return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
  62. // }
  63. public function conlist(){
  64. $page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) :"1";
  65. $size = isset($this->post['size']) && $this->post['size'] !== "" ? intval($this->post['size']) :"10";
  66. $where=[['a.is_del',"=",0],['b.is_del',"=",0]];
  67. $zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
  68. if ($zxNo !== "") {
  69. $where[] = ['a.zxNo','=',$zxNo];
  70. }
  71. // $sequenceNo = isset($this->post['sequenceNo']) && $this->post['sequenceNo'] !== "" ? trim($this->post['sequenceNo']) : "";
  72. // if ($sequenceNo !== "") {
  73. // $where[] = ['sequenceNo','like',"%$sequenceNo%"];
  74. // }
  75. $salesman = isset($this->post['salesman']) && $this->post['salesman'] !== "" ? trim($this->post['salesman']) : "";
  76. if ($salesman !== "") {
  77. //$where["salesman"] =Db::Raw("like '%$salesman%'");
  78. $where[]= ["b.salesman",'like',"%$salesman%"];
  79. }
  80. $cpName = isset($this->post['cpName']) && $this->post['cpName'] !== "" ? trim($this->post['cpName']) : "";
  81. if ($cpName !== "") {
  82. //$where["cpName"]= Db::Raw("like '%$cpName%'");
  83. $where[]= ["a.good_Name",'like',"%$cpName%"];
  84. }
  85. $khNo = isset($this->post['khNo']) && $this->post['khNo'] !== "" ? trim($this->post['khNo']) : "";
  86. if ($khNo !== "") {
  87. // $where['khNo'] = $khNo;
  88. $where[]= ["b.khNo",'like',"%$khNo%"];
  89. }
  90. $start= isset($this->post['start']) && $this->post['start'] !== "" ? $this->post['start']:"";
  91. if ($start !="") {
  92. //$where = ["zxtime"=>Db::raw(">= '{$start}'")];
  93. $where[]= ["a.addtime",'>=',$start];
  94. }
  95. $end = isset($this->post['end']) && $this->post['end'] !== "" ? $this->post['end'] :"";
  96. if($end !=""){
  97. $where[]= ["a.addtime",'<=',$end];
  98. }
  99. $status = isset($this->post['status']) && $this->post['status'] !== "" ? trim($this->post['status']) : "";
  100. if ($status !== "") {
  101. $where[]= ["a.status",'=',$status];
  102. }
  103. $count = Db::name('consult_info')->alias("a")->leftJoin("consult_order b","a.zxNo=b.zxNo")->where($where)
  104. ->count();
  105. $total = ceil($count / $size);
  106. $page = $page >= $total ? $total : $page;
  107. $list =Db::name('consult_info')->alias("a")->leftJoin("consult_order b","a.zxNo=b.zxNo")->where($where)->page($page,$size)
  108. ->field("a.*,b.createrid,b.creater,b.is_project,b.projectNo,b.khNo,b.endtime,b.platform_code,b.saleid,b.salesman,b.depart")->select();
  109. $data=[];
  110. foreach ($list as $value){
  111. $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
  112. $value['khname']="";
  113. if($value['khNo']!==""){
  114. $kh=Db::name("customer_info")->where(['companyNo'=>$value['khNo']])->find();
  115. $value['khname']= isset($kh['companyName'])?$kh['companyName']:"";
  116. }
  117. $data[]=$value;
  118. }
  119. return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
  120. }
  121. public function info(){
  122. $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) : "";
  123. if($id==""){
  124. return error_show(1002,"咨询单编号不能为空");
  125. }
  126. $fo = Db::name('consult')->where(['id'=>$id,'is_del'=>0])->find();
  127. $in= isset($fo['cat_id']) && $fo['cat_id'] !=0 ? made($fo['cat_id']):[];
  128. $fo['can']=$in;
  129. if(empty($fo)){
  130. return error_show(1002,"未找到咨询单编号");
  131. }else{
  132. return app_show(0,"获取成功",$fo);
  133. }
  134. }
  135. public function del(){
  136. $id = isset($this->post['id']) && $this->post['id'] !=="" ? intval($this->post['id']) : "";
  137. $de = Db::name('consult')->where(['id'=>$id,'is_del'=>0])->find();
  138. if($de==false){
  139. return error_show(1002,'咨询单信息未找到');
  140. }
  141. $dell= Db::name('consult')->update(['id'=>$id,'is_del'=>1,'updatetime'=>date("Y-m-d H:i:s")]);
  142. if($dell){
  143. return error_show(0,"删除成功");
  144. }else
  145. return error_show(1002,"删除失败");
  146. }
  147. public function create(){
  148. $is_project= isset($this->post['is_project']) && $this->post['is_project'] !=="" ? intval($this->post['is_project']) : "";
  149. if($is_project===""){
  150. return error_show(1002,"参数is_project不能为空");
  151. }
  152. if($is_project==1){
  153. $projectNo= isset($this->post['projectNo']) && $this->post['projectNo'] !=="" ? trim($this->post['projectNo']) : "";
  154. if($projectNo===""){
  155. return error_show(1002,"参数projectNo不能为空");
  156. }
  157. }
  158. $khNo = isset($this->post['khNo']) && $this->post['khNo'] !=="" ? trim($this->post['khNo']) : "";
  159. if($khNo===""){
  160. return error_show(1002,"参数khNo不能为空");
  161. }
  162. $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] !=="" ? trim($this->post['companyNo']) : "";
  163. if($companyNo===""){
  164. return error_show(1002,"参数companyNo不能为空");
  165. }
  166. $endtime = isset($this->post['endtime']) && $this->post['endtime'] !=="" ? $this->post['endtime'] : "";
  167. if($endtime===""){
  168. return error_show(1002,"参数endtime不能为空");
  169. }
  170. // $saleid = isset($this->post['saleid']) && $this->post['saleid'] !=="" ? intval($this->post['saleid']) : "";
  171. // if($saleid===""){
  172. // return error_show(1002,"参数saleid不能为空");
  173. // }
  174. // $depart = isset($this->post['depart']) && $this->post['depart'] !=="" ? intval($this->post['depart']) : "";
  175. // if($depart===""){
  176. // return error_show(1002,"参数depart不能为空");
  177. // }
  178. $platform_code = isset($this->post['platform_code']) && $this->post['platform_code'] !=="" ? trim($this->post['platform_code']) :
  179. "";
  180. if($platform_code===""){
  181. return error_show(1002,"参数platform_code不能为空");
  182. }
  183. $ladder = isset($this->post['ladder'])&&!empty($this->post['ladder']) ? $this->post['ladder']:"";
  184. if($ladder==""){
  185. return error_show(1005,"参数ladder不能为空");
  186. }
  187. $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
  188. if($token==''){
  189. return error_show(1005,"参数token不能为空");
  190. }
  191. $user =GetUserInfo($token);
  192. if(empty($user)||$user['code']!=0){
  193. return error_show(1002,"用户数据不存在");
  194. }
  195. $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
  196. $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
  197. $depart= Db::name("depart_user")->where(["uid"=>$createrid,"status"=>1,"is_del"=>0])->find();
  198. $zxNo=makeNo("ZX");
  199. $data=[
  200. "zxNo"=>$zxNo,
  201. "createrid"=>$createrid,
  202. "creater"=>$creater,
  203. "is_project"=>$is_project,
  204. "projectNo"=>isset($projectNo) ? $projectNo:"",
  205. "khNo"=>$khNo,
  206. "companyNo"=>$companyNo,
  207. "endtime"=>$endtime,
  208. "salesman"=>$creater,
  209. "platform_code"=>$platform_code,
  210. "saleid"=>$createrid,
  211. "depart"=>isset($depart['itemid'])?$depart['itemid']:0,
  212. "status"=>0,
  213. "is_del"=>0,
  214. "addtime"=>date("Y-m-d H:i:s"),
  215. "updatetime"=>date("Y-m-d H:i:s"),
  216. ];
  217. $zx = Db::name("consult_order")->insert($data);
  218. if($zx){
  219. foreach ($ladder as $value){
  220. $infoNo=makeNo("INF");
  221. $specinfo=[];
  222. if(isset($value['specinfo']) &&!empty($value['specinfo'])){
  223. foreach ($value["specinfo"] as $v){
  224. $spec =Db::name("specs")->where(["id"=>$v['specid']])->find();
  225. $spec_value =Db::name("spec_value")->where(["id"=>$v['spec_value_id']])->find();
  226. $v['spec_name']=$spec['spec_name'];
  227. $v['spec_value_name']=$spec_value['spec_value'];
  228. $specinfo[]=$v;
  229. }
  230. }
  231. $info=[
  232. "infoNo"=>$infoNo,
  233. "zxNo"=>$zxNo,
  234. "spuCode"=>"",
  235. "good_name"=>$value['good_name'],
  236. "good_img"=>$value['good_img'],
  237. "cat_id"=>$value['cat_id'],
  238. "unit"=>$value['unit'],
  239. "brand_id"=>$value['brand_id'],
  240. "arrival_time"=>$value['arrival_time'],
  241. "specinfo"=>empty($specinfo)?"" : json_encode($specinfo),
  242. "cost_desc"=>$value['cost_desc'],
  243. "is_addrs"=>$value['is_addrs'],
  244. "is_custom"=>$value['is_custom'],
  245. "metal_id"=>$value['metal_id'],
  246. "config"=>isset($value['config'])?$value['config']:"",
  247. "other_config"=>isset($value['other_config'])?$value['other_config']:"",
  248. "specs_weight"=>isset($value['specs_weight'])?$value['specs_weight']:"0",
  249. "gold_price"=>isset($value['gold_price'])?$value['gold_price']:"0",
  250. "is_gold_price"=>isset($value['is_gold_price'])?$value['is_gold_price']:"0",
  251. "total_weight"=>isset($value['total_weight'])?$value['total_weight']:"0",
  252. "budget_price"=>$value['budget_price'],
  253. "num"=>$value['num'],
  254. "pgNo"=>isset($value['pgNo'])&&$value['pgNo']!==""?trim($value['pgNo']):"",
  255. "use_desc"=>$value['use_desc'],
  256. "remark"=>$value['remark'],
  257. "status"=>1,
  258. "is_del"=>0,
  259. "addtime"=>date("Y-m-d H:i:s"),
  260. "updatetime"=>date("Y-m-d H:i:s")
  261. ];
  262. $up = Db::name("consult_info")->insert($info);
  263. if(!$up){
  264. Db::rollback();
  265. return error_show(1004,'添加失败');
  266. }
  267. }
  268. return app_show(0,"新建成功",["zxNo"=>$zxNo]);
  269. }else{
  270. return error_show(1004,"新建失败");
  271. }
  272. }
  273. // public function zxadd(){
  274. // $good_name = isset($this->post['good_name'])&&$this->post['good_name']!==""?trim($this->post['good_name']):"";
  275. // if($good_name===""){
  276. // return error_show(1004,"参数good_name不能为空");
  277. // }
  278. // $zxNo = isset($this->post['zxNo'])&&$this->post['zxNo']!==""?trim($this->post['zxNo']):"";
  279. // if($zxNo===""){
  280. // return error_show(1004,"参数zxNo不能为空");
  281. // }
  282. //
  283. // $cat_id = isset($this->post['cat_id'])&&$this->post['cat_id']!==""?intval($this->post['cat_id']):"";
  284. // if($cat_id===""){
  285. // return error_show(1004,"参数cat_id不能为空");
  286. // }
  287. // $arrival_time = isset($this->post['arrival_time'])&&$this->post['arrival_time']!==""?$this->post['arrival_time']
  288. // :"";
  289. // if($arrival_time===""){
  290. // return error_show(1004,"参数arrival_time不能为空");
  291. // }
  292. // $good_img = isset($this->post['good_img'])&&$this->post['good_img']!==""?trim($this->post['good_img']):"";
  293. // if($good_img===""){
  294. // return error_show(1004,"参数good_img不能为空");
  295. // }
  296. // $is_custom = isset($this->post['is_custom'])&&$this->post['is_custom']!==""?intval($this->post['is_custom']):"";
  297. // if($is_custom===""){
  298. // return error_show(1004,"参数is_custom不能为空");
  299. // }
  300. // $unit = isset($this->post['unit'])&&$this->post['unit']!==""?trim($this->post['unit']):"";
  301. // if($unit===""){
  302. // return error_show(1004,"参数unit不能为空");
  303. // }
  304. // $brand_id = isset($this->post['brand_id'])&&$this->post['brand_id']!==""?intval($this->post['brand_id']):"";
  305. // if($brand_id===""){
  306. // return error_show(1004,"参数brand_id不能为空");
  307. // }
  308. // $material = isset($this->post['material'])&&$this->post['material']!==""?trim($this->post['material']):"";
  309. // if($material===""){
  310. // return error_show(1004,"参数material不能为空");
  311. // }
  312. // $color = isset($this->post['color'])&&$this->post['color']!==""?trim($this->post['color']):"";
  313. // if($color===""){
  314. // return error_show(1004,"参数color不能为空");
  315. // }
  316. // $cost_desc = isset($this->post['cost_desc'])&&$this->post['cost_desc']!==""?trim($this->post['cost_desc']):"";
  317. // if($cost_desc===""){
  318. // return error_show(1004,"参数cost_desc不能为空");
  319. // }
  320. // $model = isset($this->post['model'])&&$this->post['model']!==""?trim($this->post['model']):"";
  321. // if($model===""){
  322. // return error_show(1004,"参数model不能为空");
  323. // }
  324. //
  325. // $is_addrs = isset($this->post['is_addrs'])&&$this->post['is_addrs']!==""?intval($this->post['is_addrs']):"";
  326. // if($is_addrs===""){
  327. // return error_show(1004,"参数is_addrs不能为空");
  328. // }
  329. //
  330. // $metal_id = isset($this->post['metal_id'])&&$this->post['metal_id']!==""?trim($this->post['metal_id']):"";
  331. // if($metal_id===""){
  332. // return error_show(1004,"参数metal_id不能为空");
  333. // }
  334. // if($metal_id==0){
  335. // $config = isset($this->post['config'])&&!empty($this->post['config'])?$this->post['config']:"";
  336. // if($config===""){
  337. // return error_show(1004,"参数config不能为空");
  338. // }
  339. // $other_config = isset($this->post['other_config'])&&$this->post['other_config']!==""?trim($this->post['other_config'])
  340. // :"";
  341. // if($other_config===""){
  342. // return error_show(1004,"参数other_config不能为空");
  343. // }
  344. // $specs_weight = isset($this->post['specs_weight'])&&$this->post['specs_weight']!==""?floatval($this->post['specs_weight']):"";
  345. // if($specs_weight===""){
  346. // return error_show(1004,"参数specs_weight不能为空");
  347. // }
  348. // $gold_price = isset($this->post['gold_price'])&&$this->post['gold_price']!==""?floatval($this->post['gold_price']):"";
  349. // if($gold_price===""){
  350. // return error_show(1004,"参数gold_price不能为空");
  351. // }
  352. //
  353. // }
  354. // $budget_price = isset($this->post['budget_price'])&&$this->post['budget_price']!==""?floatval($this->post['budget_price']):"";
  355. // if($budget_price===""){
  356. // return error_show(1004,"参数budget_price不能为空");
  357. // }
  358. // $num = isset($this->post['num'])&&$this->post['num']!==""?intval($this->post['num']):"";
  359. // if($num===""){
  360. // return error_show(1004,"参数num不能为空");
  361. // }
  362. // $use_desc = isset($this->post['use_desc'])&&$this->post['use_desc']!==""?trim($this->post['use_desc']):"";
  363. // if($use_desc===""){
  364. // return error_show(1004,"参数use_desc不能为空");
  365. // }
  366. // $remark = isset($this->post['remark'])&&$this->post['remark']!==""?trim($this->post['remark']):"";
  367. // if($remark===""){
  368. // return error_show(1004,"参数remark不能为空");
  369. // }
  370. //
  371. // Db::startTrans();
  372. // try{
  373. // $infoNo=makeNo("INF");
  374. // $info=[
  375. // "infoNo"=>$infoNo,
  376. // "zxNo"=>$zxNo,
  377. // "spuCode"=>"",
  378. // "good_name"=>$good_name,
  379. // "good_img"=>$good_img,
  380. // "cat_id"=>$cat_id,
  381. // "unit"=>$unit,
  382. // "brand_id"=>$brand_id,
  383. // "arrival_time"=>$arrival_time,
  384. // "model"=>$model,
  385. // "color"=>$color,
  386. // "material"=>$material,
  387. // "cost_desc"=>$cost_desc,
  388. // "is_addrs"=>$is_addrs,
  389. // "is_custom"=>$is_custom,
  390. // "metal_id"=>$metal_id,
  391. // "config"=>isset($config)?$config:"",
  392. // "other_config"=>isset($other_config)?$other_config:"",
  393. // "specs_weight"=>isset($specs_weight)?$specs_weight:0,
  394. // "gold_price"=>isset($gold_price)?$gold_price:0,
  395. // "budget_price"=>$budget_price,
  396. // "num"=>$num,
  397. // "use_desc"=>$use_desc,
  398. // "remark"=>$remark,
  399. // "status"=>0,
  400. // "is_del"=>0,
  401. // "addtime"=>date("Y-m-d H:i:s"),
  402. // "updatetime"=>date("Y-m-d H:i:s")
  403. // ];
  404. // $up = Db::name("consult_info")->insert($info);
  405. // if($up){
  406. // Db::commit();
  407. // return app_show(0,"添加成功",["infoNo"=>$infoNo]);
  408. // }else{
  409. // Db::rollback();
  410. // return error_show(1004,'添加失败');
  411. // }
  412. // }catch (\Exception $e){
  413. // Db::rollback();
  414. // return error_show(1004,$e->getMessage());
  415. // }
  416. // }
  417. public function zxinfo(){
  418. $infoNo= isset($this->post['infoNo'])&&$this->post['infoNo']!=""?trim($this->post['infoNo']):"";
  419. if($infoNo==""){
  420. return error_show(1004,"参数infoNo不能为空");
  421. }
  422. $zxinfo = Db::name("consult_info")->where(["infoNo"=>$infoNo,"is_del"=>0])->find();
  423. if($zxinfo==false){
  424. return error_show(1004,"未找到信息数据");
  425. }
  426. $zxorder = Db::name("consult_order")->where(["zxNo"=>$zxinfo['zxNo'],"is_del"=>0])->find();
  427. if($zxorder==false){
  428. return error_show(1004,"未找到咨询信息数据");
  429. }
  430. $cat =Db::name("cat")->where(["id"=>$zxinfo['cat_id']])->find();
  431. $budget = isset($cat['order_rate']) ? $cat['order_rate']:100;
  432. $zxinfo['can']= isset($zxinfo['cat_id']) && $zxinfo['cat_id'] !=0 ? made($zxinfo['cat_id'],[]):[];
  433. $zxinfo['khname']="";
  434. $zxinfo['original_price']=sprintf("%.2f",$zxinfo['budget_price']* (1 -$budget/100));
  435. $zxinfo['khNo']="";
  436. $zxinfo['brand_id']=$zxinfo['brand_id']==0 ?"":$zxinfo['brand_id'];
  437. $zxinfo['brand']="";
  438. $zxinfo['companyNo']=isset($zxorder['companyNo'])?$zxorder['companyNo']:"";
  439. $zxinfo['projectNo']=isset($zxorder['projectNo'])?$zxorder['projectNo']:"";
  440. $zxinfo['is_project']=isset($zxorder['is_project'])?$zxorder['is_project']:"";
  441. $zxinfo['company']="";
  442. $zxinfo['endtime']=isset($zxorder['endtime'])?$zxorder['endtime']:"";
  443. $zxinfo['platform_code'] =isset($zxorder['platform_code'])?$zxorder['platform_code']:"";
  444. $zxinfo['salesman'] =isset($zxorder['salesman'])?$zxorder['salesman']:"";
  445. $zxinfo['saleid'] =isset($zxorder['saleid'])?$zxorder['saleid']:"";
  446. $zxinfo['depart'] =isset($zxorder['depart'])?$zxorder['depart']:"";
  447. $zxinfo['project_name']="";
  448. $zxinfo['budget_total']="";
  449. $zxinfo['departinfo']=[];
  450. $zxinfo['unit_name']="";
  451. $zxinfo['specinfo']=json_decode($zxinfo['specinfo'],true);
  452. if($zxorder['khNo']!==""){
  453. $kh=Db::name("customer_info")->where(['companyNo'=>$zxorder['khNo']])->find();
  454. $zxinfo['khname']= isset($kh['companyName'])?$kh['companyName']:"";
  455. $zxinfo['khNo']= $zxorder['khNo'];
  456. }
  457. if($zxinfo['unit']!==""){
  458. $unit=Db::name("unit")->where(['id'=>$zxinfo['unit']])->find();
  459. $zxinfo['unit_name']= isset($unit['unit'])?$unit['unit']:"";
  460. }
  461. if($zxinfo['brand_id']!==""){
  462. $unit=Db::name("brand")->where(['id'=>$zxinfo['brand_id']])->find();
  463. $zxinfo['brand']= isset($unit['brand_name'])?$unit['brand_name']:"";
  464. }
  465. if($zxorder['companyNo']!==""){
  466. $kh=Db::name("business")->where(['companyNo'=>$zxorder['companyNo']])->find();
  467. $zxinfo['company']= isset($kh['company'])?$kh['company']:"";
  468. }
  469. if($zxorder['is_project']==1 && $zxorder['projectNo']!==""){
  470. $project = Db::name("project")->where(["projectNo"=>$zxorder['projectNo'],"is_del"=>0])->find();
  471. $zxinfo['project_name']=isset($project['project_name'])?$project['project_name']:"";
  472. $zxinfo['budget_total']=isset($project['budget_total'])?$project['budget_total']:"";
  473. $zxinfo['project_use_desc']=isset($project['use_desc'])?$project['use_desc']:"";
  474. $projectinfo = Db::name("project_info")->where(["pgNo"=>$zxinfo['infoNo']])->find();
  475. $zxinfo['pgNo'] = isset($projectinfo['pgNo']) ? $projectinfo['pgNo']:"";
  476. }
  477. if($zxorder['depart']>0){
  478. $zxinfo['departinfo']=GetPart($zxorder['depart']);
  479. }
  480. if($zxorder['platform_code']>0){
  481. $palt=Db::name("platform")->where(["id"=>$zxorder['platform_code']])->find();
  482. $zxinfo['platform_name']=isset($palt['platform_name'])?$palt['platform_name']:"";
  483. }
  484. return app_show(0,"获取成功",$zxinfo);
  485. }
  486. public function zxedit(){
  487. $infoNo= isset($this->post['infoNo'])&&$this->post['infoNo']!=""?trim($this->post['infoNo']):"";
  488. if($infoNo==""){
  489. return error_show(1004,"参数infoNo不能为空");
  490. }
  491. $zxinfo = Db::name("consult_info")->where(["infoNo"=>$infoNo,"is_del"=>0])->find();
  492. if($zxinfo==false){
  493. return error_show(1004,"未找到信息数据");
  494. }
  495. $good_name= isset($this->post['good_name'])&&$this->post['good_name']!=""?trim($this->post['good_name']):"";
  496. if($good_name==""){
  497. return error_show(1003,"参数good_name不能为空");
  498. }
  499. $good_img= isset($this->post['good_img'])&&$this->post['good_img']!=""?trim($this->post['good_img']):"";
  500. if($good_img==""){
  501. return error_show(1003,"参数good_img不能为空");
  502. }
  503. $cat_id= isset($this->post['cat_id'])&&$this->post['cat_id']!=""?intval($this->post['cat_id']):"";
  504. if($cat_id==""){
  505. return error_show(1003,"参数cat_id不能为空");
  506. }
  507. $unit= isset($this->post['unit'])&&$this->post['unit']!=""?trim($this->post['unit']):"";
  508. if($unit==""){
  509. return error_show(1003,"参数unit不能为空");
  510. }
  511. $brand_id= isset($this->post['brand_id'])&&$this->post['brand_id']!==""?intval($this->post['brand_id']):"0";
  512. $arrival_time= isset($this->post['arrival_time'])&&$this->post['arrival_time']!=""?$this->post['arrival_time']:"";
  513. if($arrival_time==""){
  514. return error_show(1003,"参数arrival_time不能为空");
  515. }
  516. $specin= isset($this->post['specinfo'])&&!empty($this->post['specinfo'])?$this->post['specinfo']:"";
  517. if($specin==""){
  518. return error_show(1003,"参数specinfo不能为空");
  519. }
  520. // $color= isset($this->post['color'])&&$this->post['color']!=""?trim($this->post['color']):"";
  521. // if($color==""){
  522. // return error_show(1003,"参数color不能为空");
  523. // }
  524. // $material= isset($this->post['material'])&&$this->post['material']!=""?trim($this->post['material']):"";
  525. // if($material==""){
  526. // return error_show(1003,"参数material不能为空");
  527. // }
  528. $cost_desc= isset($this->post['cost_desc'])&&$this->post['cost_desc']!=""?trim($this->post['cost_desc']):"";
  529. if($cost_desc==""){
  530. return error_show(1003,"参数cost_desc不能为空");
  531. }
  532. $is_addrs= isset($this->post['is_addrs'])&&$this->post['is_addrs']!==""?intval($this->post['is_addrs']):"";
  533. if($is_addrs===""){
  534. return error_show(1003,"参数is_addrs不能为空");
  535. }
  536. $is_custom= isset($this->post['is_custom'])&&$this->post['is_custom']!==""?trim($this->post['is_custom']):"";
  537. if($is_custom===""){
  538. return error_show(1003,"参数is_custom不能为空");
  539. }
  540. $metal_id= isset($this->post['metal_id'])&&$this->post['metal_id']!==""?intval($this->post['metal_id']):"";
  541. if($metal_id===""){
  542. return error_show(1003,"参数metal_id不能为空");
  543. }
  544. $config = isset($this->post['config'])&& $this->post['config']!=""?trim($this->post['config']):"";
  545. $other_config = isset($this->post['other_config'])&& $this->post['other_config']!=""?trim($this->post['other_config']):"";
  546. $specs_weight = isset($this->post['specs_weight'])&& $this->post['specs_weight']!==""?floatval($this->post['specs_weight']):"";
  547. $gold_price = isset($this->post['gold_price'])&& $this->post['gold_price']!==""?floatval($this->post['gold_price']):"";
  548. $is_gold_price = isset($this->post['is_gold_price'])&& $this->post['is_gold_price']!==""?intval($this->post['is_gold_price']):"0";
  549. $budget_price = isset($this->post['budget_price'])&& $this->post['budget_price']!==""?floatval($this->post['budget_price']):"";
  550. $total_weight = isset($this->post['total_weight'])&& $this->post['total_weight']!==""?floatval($this->post['total_weight']):"";
  551. $num = isset($this->post['num'])&& $this->post['num']!==""?intval($this->post['num']):"";
  552. if($num===""){
  553. return error_show(1003,"参数num不能为空");
  554. }
  555. if($budget_price===""){
  556. return error_show(1003,"参数budget_price不能为空");
  557. }
  558. $use_desc = isset($this->post['use_desc'])&& $this->post['use_desc']!="" ? trim($this->post['use_desc']):"";
  559. if($use_desc==""){
  560. return error_show(1003,"参数use_desc不能为空");
  561. }
  562. $remark = isset($this->post['remark'])&& $this->post['remark']!="" ? trim($this->post['remark']):"";
  563. if($remark==""){
  564. return error_show(1003,"参数remark不能为空");
  565. }
  566. if($metal_id!=0){
  567. if($config==""){
  568. return error_show(1003,"参数config不能为空");
  569. }
  570. if($other_config==""){
  571. return error_show(1003,"参数other_config不能为空");
  572. }
  573. if($specs_weight===""){
  574. return error_show(1003,"参数specs_weight不能为空");
  575. }
  576. if($gold_price===""){
  577. return error_show(1003,"参数gold_price不能为空");
  578. }
  579. }
  580. $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
  581. if($token==''){
  582. return error_show(102,"参数token不能为空");
  583. }
  584. $user =GetUserInfo($token);
  585. if(empty($user)||$user['code']!=0){
  586. return error_show(105,"用户数据不存在");
  587. }
  588. $specinfo=[];
  589. foreach ($specin as $v){
  590. $spec =Db::name("specs")->where(["id"=>$v['specid']])->find();
  591. $spec_value =Db::name("spec_value")->where(["id"=>$v['spec_value_id']])->find();
  592. $v['spec_name']=isset($spec['spec_name'])?$spec['spec_name']:"";
  593. $v['spec_value_name']=isset($spec_value['spec_value'])?$spec_value['spec_value']:"";
  594. $specinfo[]=$v;
  595. }
  596. $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
  597. $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
  598. $bidlist = Db::name("consult_bids")->where(["infoNo"=>$zxinfo['infoNo'],"is_del"=>0])->select();
  599. try{
  600. $innew =makeNo("INF");
  601. $info=[
  602. "infoNo"=>$innew,
  603. "zxNo"=>$zxinfo['zxNo'],
  604. "spuCode"=>"",
  605. "good_name"=>$good_name,
  606. "good_img"=>$good_img,
  607. "cat_id"=>$cat_id,
  608. "unit"=>$unit,
  609. "brand_id"=>$brand_id,
  610. "arrival_time"=>$arrival_time,
  611. "specinfo"=>json_encode($specinfo),
  612. // "color"=>$color,
  613. // "material"=>$material,
  614. "cost_desc"=>$cost_desc,
  615. "is_addrs"=>$is_addrs,
  616. "is_custom"=>$is_custom,
  617. "metal_id"=>$metal_id,
  618. "config"=>$config,
  619. "other_config"=>$other_config,
  620. "specs_weight"=>$specs_weight===""?0:$specs_weight,
  621. "gold_price"=>$gold_price===""? 0 : $gold_price,
  622. "is_gold_price"=>$is_gold_price===""?0:$is_gold_price,
  623. "total_weight"=>$total_weight===""? $num*$specs_weight :$total_weight,
  624. "budget_price"=>$budget_price,
  625. "num"=>$num,
  626. "use_desc"=>$use_desc,
  627. "remark"=>$remark,
  628. "status"=>1,
  629. "is_del"=>0,
  630. "addtime"=>date("Y-m-d H:i:s"),
  631. "updatetime"=>date("Y-m-d H:i:s")
  632. ];
  633. $up = Db::name("consult_info")->insert($info);
  634. if($up){
  635. if (!empty($bidlist)){
  636. foreach ($bidlist as $value){
  637. unset($value['id']);
  638. $value['infoNo']=$innew;
  639. $value['sale_price'] =$value['total_price'];
  640. $value['status'] =0;
  641. $value['updatetime'] =date("Y-m-d H:i:s");
  642. $in = Db::name("consult_bids")->insert($value);
  643. if($in==false){
  644. Db::rollback();
  645. return error_show(1004,"反馈商品新建失败");
  646. }
  647. }
  648. }
  649. $zxinfo["bargain_status"] =1;
  650. $zxinfo["bargain_code"] =$innew;
  651. $zxinfo["updatetime"] =date("Y-m-d H:i:s");
  652. $bar=Db::name("consult_info")->save($zxinfo);
  653. if($bar==false){
  654. Db::rollback();
  655. return error_show(1004,"反馈商品更新失败");
  656. }
  657. Db::commit();
  658. return app_show(0,"咨询新建成功",["infoNo"=>$innew]);
  659. }
  660. }catch (\Exception $e){
  661. Db::rollback();
  662. return error_show(1004,$e->getMessage());
  663. }
  664. }
  665. //** 发布竞标任务 */
  666. public function bargain(){
  667. $infoNo= isset($this->post['infoNo'])&&$this->post['infoNo']!=""?trim($this->post['infoNo']):"";
  668. if($infoNo==""){
  669. return error_show(1004,"参数infoNo不能为空");
  670. }
  671. $zxinfo = Db::name("consult_info")->where(["infoNo"=>$infoNo,"is_del"=>0])->find();
  672. if($zxinfo==false){
  673. return error_show(1004,"未找到信息数据");
  674. }
  675. $status =isset($this->post['status']) && $this->post['status']!=="" ? intval($this->post['status']):"";
  676. if($status===""){
  677. return error_show(1004,"参数status不能为空");
  678. }
  679. if($status==1&&$zxinfo['status']>1){
  680. $zxinfo['bargain_num']=+1;
  681. }
  682. $zxinfo['status']=$status;
  683. $zxinfo['updatetime']=date("Y-m-d H:i:s");
  684. $up = Db::name("consult_info")->save($zxinfo);
  685. if($up){
  686. return app_show(0,"状态更新成功");
  687. }else{
  688. return error_show(1003,"状态更新失败");
  689. }
  690. }
  691. public function feadback(){
  692. $infoNo= isset($this->post['infoNo'])&&$this->post['infoNo']!=""?trim($this->post['infoNo']):"";
  693. if($infoNo==""){
  694. return error_show(1002,"参数infoNo不能为空");
  695. }
  696. $zxinfo = Db::name("consult_info")->where(["infoNo"=>$infoNo,"is_del"=>0])->find();
  697. if($zxinfo==false){
  698. return error_show(1003,"未找到信息数据");
  699. }
  700. if($zxinfo['status']!=1){
  701. return error_show(1004,"任务未进行");
  702. }
  703. $pname = isset($this->post['pname'])&&$this->post['pname']!=""? trim($this->post['pname']):"";
  704. if($pname==""){
  705. return error_show(1002,"参数pname不能为空");
  706. }
  707. $brandid = isset($this->post['brandid'])&&$this->post['brandid']!=""? intval($this->post['brandid']):"";
  708. // if($brandid==""){
  709. // return error_show(1002,"参数brandid不能为空");
  710. // }
  711. $cat_id = isset($this->post['cat_id'])&&$this->post['cat_id']!=""? trim($this->post['cat_id']):"";
  712. if($cat_id==""){
  713. return error_show(1002,"参数cat_id不能为空");
  714. }
  715. $specin= isset($this->post['specinfo'])&&!empty($this->post['specinfo'])?$this->post['specinfo']:"";
  716. if($specin==""){
  717. return error_show(1003,"参数specinfo不能为空");
  718. }
  719. $specinfo=[];
  720. foreach ($specin as $v){
  721. $spec =Db::name("specs")->where(["id"=>$v['specid']])->find();
  722. $spec_value =Db::name("spec_value")->where(["id"=>$v['spec_value_id']])->find();
  723. $v['spec_name']=isset($spec['spec_name'])?$spec['spec_name']:"";
  724. $v['spec_value_name']=isset($spec_value['spec_value'])?$spec_value['spec_value']:"";
  725. $specinfo[]=$v;
  726. }
  727. // $model = isset($this->post['model'])&&$this->post['model']!=""? trim($this->post['model']):"";
  728. // //$unit = isset($this->post['model'])&&$this->post['model']!=""? trim($this->post['model']):"";
  729. // $material = isset($this->post['material'])&&$this->post['material']!=""? trim($this->post['material']):"";
  730. // $color = isset($this->post['color'])&&$this->post['color']!=""? trim($this->post['color']):"";
  731. $unit_id = isset($this->post['unit_id'])&&$this->post['unit_id']!=""? intval($this->post['unit_id']):"";
  732. $cost_desc = isset($this->post['cost_desc'])&&$this->post['cost_desc']!=""? trim($this->post['cost_desc']):"";
  733. $work_day = isset($this->post['work_day'])&&$this->post['work_day']!=""? intval($this->post['work_day']):"";
  734. $delivery_day = isset($this->post['delivery_day'])&&$this->post['delivery_day']!=""? intval($this->post['delivery_day']):"";
  735. $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? trim($this->post['good_img']):"";
  736. $expire_day = isset($this->post['expire_day'])&&$this->post['expire_day']!=""? intval($this->post['expire_day'])
  737. :"";
  738. $origin_place = isset($this->post['origin_place'])&&$this->post['origin_place']!=""? trim($this->post['origin_place']):"";
  739. $supplierNo = isset($this->post['supplierNo'])&&$this->post['supplierNo']!=""? trim($this->post['supplierNo']):"";
  740. $pay_way = isset($this->post['pay_way'])&&$this->post['pay_way']!=""? intval($this->post['pay_way']):"";
  741. $tax = isset($this->post['tax'])&&$this->post['tax']!=""? trim($this->post['tax']):"";
  742. $send_way = isset($this->post['send_way'])&&$this->post['send_way']!=""? intval($this->post['send_way']):"";
  743. $metal_id = isset($this->post['metal_id'])&&$this->post['metal_id']!=""? intval($this->post['metal_id']):"";
  744. $is_gold_price = isset($this->post['is_gold_price'])&&$this->post['is_gold_price']!=""? intval($this->post['is_gold_price']):"";
  745. $config = isset($this->post['config'])&&$this->post['config']!=""? $this->post['config']:"";
  746. $weight = isset($this->post['weight'])&&$this->post['weight']!=""? floatval($this->post['weight']):"";
  747. $demo_fee = isset($this->post['demo_fee'])&&$this->post['demo_fee']!=""? floatval($this->post['demo_fee']):"";
  748. $delivery_fee = isset($this->post['delivery_fee'])&&$this->post['delivery_fee']!=""? floatval($this->post['delivery_fee']):"";
  749. $open_fee = isset($this->post['open_fee'])&&$this->post['open_fee']!=""? floatval($this->post['open_fee']):"";
  750. $pakge_fee = isset($this->post['pakge_fee'])&&$this->post['pakge_fee']!=""? floatval($this->post['pakge_fee']):"";
  751. $nake_fee = isset($this->post['nake_fee'])&&$this->post['nake_fee']!=""? floatval($this->post['nake_fee']):"";
  752. $mark_fee = isset($this->post['mark_fee'])&&$this->post['mark_fee']!=""? floatval($this->post['mark_fee']):"";
  753. $cert_fee = isset($this->post['cert_fee'])&&$this->post['cert_fee']!=""? floatval($this->post['cert_fee']):"";
  754. $cost_fee = isset($this->post['cost_fee'])&&$this->post['cost_fee']!=""? floatval($this->post['cost_fee']):"";
  755. $total_fee = isset($this->post['total_fee'])&&$this->post['total_fee']!=""? floatval($this->post['total_fee']):"";
  756. $is_diff = isset($this->post['is_diff'])&&$this->post['is_diff']!==""? intval($this->post['is_diff']):"";
  757. $supply_area = isset($this->post['supply_area'])&&$this->post['supply_area']!==""? intval($this->post['supply_area']):"";
  758. $remark = isset($this->post['remark'])&&$this->post['remark']!=""? trim($this->post['remark']):"";
  759. $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
  760. if($token==''){
  761. return error_show(1002,"参数token不能为空");
  762. }
  763. $user =GetUserInfo($token);
  764. if(empty($user)||$user['code']!=0){
  765. return error_show(1005,"用户数据不存在");
  766. }
  767. $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
  768. $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
  769. $bidNo=makeNo("BD");
  770. $spucode=makeNo("SPU");
  771. $data=[
  772. "bidNo"=>$bidNo,
  773. "infoNo"=>$infoNo,
  774. "zxNo"=>$zxinfo['zxNo'],
  775. "spuCode"=>$spucode,
  776. "good_name"=>$pname,
  777. "brand_id"=>$brandid,
  778. "cat_id"=>$cat_id,
  779. "specinfo"=>json_encode($specinfo),
  780. // "color"=>$color,
  781. // "material"=>$material,
  782. "unit_id"=>$unit_id,
  783. "cost_desc"=>$cost_desc,
  784. "work_day"=>$work_day,
  785. "delivery_day"=>$delivery_day,
  786. "good_img"=>$good_img,
  787. "expire_day"=>$expire_day,
  788. "origin_place"=>$origin_place,
  789. "supplierNo"=>$supplierNo,
  790. "pay_way"=>$pay_way,
  791. "tax"=>$tax,
  792. "send_way"=>$send_way,
  793. "metal_id"=>$metal_id,
  794. "is_gold_price"=>$is_gold_price,
  795. "config"=>$config,
  796. "weight"=>$weight,
  797. "is_diff"=>$is_diff,
  798. "demo_fee"=>$demo_fee,
  799. "delivery_fee"=>$delivery_fee,
  800. "open_fee"=>$open_fee,
  801. "pakge_fee"=>$pakge_fee,
  802. "nake_fee"=>$nake_fee,
  803. "mark_fee"=>$mark_fee,
  804. "cert_fee"=>$cert_fee,
  805. "cost_fee"=>$cost_fee,
  806. "total_fee"=>$total_fee,
  807. "supply_area"=>$supply_area,
  808. "remark"=>$remark,
  809. "sale_price"=>0,
  810. "createrid"=>$createrid,
  811. "creater"=>$creater,
  812. "status"=>$zxinfo['status']==1 ?1 :2,
  813. "is_del"=>0,
  814. "addtime"=>date("Y-m-d H:i:s"),
  815. "updatetime"=>date("Y-m-d H:i:s")
  816. ];
  817. Db::startTrans();
  818. try{
  819. $insert= Db::name("consult_bids")->insert($data);
  820. if($insert){
  821. $data=[
  822. "spuCode"=>$spucode,
  823. "good_name"=>$pname,
  824. "brand_id"=>$brandid,
  825. "good_unit"=>$unit_id,
  826. "good_type"=>0,
  827. "moq"=>1,
  828. "customized"=>$work_day,
  829. "tax"=>$tax,
  830. "supplierNo"=>$supplierNo,
  831. "is_auth"=>0,
  832. "craft_desc"=>$cost_desc,
  833. "good_remark"=>$remark,
  834. "good_img"=>$good_img,
  835. "good_thumb_img"=>"",
  836. "good_info_img"=>"",
  837. "status"=>1,
  838. "is_del"=>0,
  839. "createrid"=>$createrid,
  840. "creater"=>$creater,
  841. "addtime"=>date("Y-m-d H:i:s"),
  842. "updatetime"=>date("Y-m-d H:i:s")
  843. ];
  844. $good = Db::name("good_zixun")->insert($data);
  845. if($good){
  846. Db::commit();
  847. return app_show(0,"反馈成功",["bidNo"=>$bidNo]);
  848. }else{
  849. Db::rollback();
  850. return error_show(1006,"反馈失败");
  851. }
  852. }else{
  853. Db::rollback();
  854. return error_show(1006,"反馈失败");
  855. }
  856. }catch (\Exception $e){
  857. Db::rollback();
  858. return error_show(1006,$e->getMessage());
  859. }
  860. }
  861. public function feadinfo(){
  862. $bidNo =isset($this->post['bidNo'])&& $this->post['bidNo']!=""?trim($this->post['bidNo']):"";
  863. if($bidNo==""){
  864. return error_show(1004,"参数bidNo不能为空");
  865. }
  866. $info =Db::name("consult_bids")->where(['bidNo'=>$bidNo,"is_del"=>0])->find();
  867. if($info==false){
  868. return error_show(1004,"未找到商品数据");
  869. }
  870. $unit =Db::name("unit")->where(["id"=>$info['unit_id']])->find();
  871. $info['unit'] = isset($unit['unit'])?$unit['unit']:'';
  872. $info['cat_info'] = made($info['cat_id'],[]);
  873. $supplier = Db::name("supplier")->where(["code"=>$info['supplierNo']])->find();
  874. $info['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
  875. if($info['brand_id']!=0){
  876. $brand=Db::name("brand")->where(["id"=>$info['brand_id']])->find();
  877. $info["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
  878. }else{
  879. $info["brand_name"]="";
  880. $info["brand_id"]="";
  881. }
  882. $catinfo = Db::name("cat")->where(["id"=>$info['cat_id']])->find();
  883. $bidinfo = Db::name("consult_info")->where(["infoNo"=>$info["infoNo"]])->find();
  884. $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']:100;
  885. $god=[
  886. "metal_id"=>$info['metal_id'],
  887. "weight"=>$info["weight"],
  888. "demo_fee"=>$info["demo_fee"],
  889. "delivery_fee"=>$info["delivery_fee"],
  890. "open_fee"=>$info["open_fee"],
  891. "packing_fee"=>$info["pakge_fee"],
  892. "mark_fee"=>$info["mark_fee"],
  893. "nake_fee"=>$info["nake_fee"],
  894. "cert_fee"=>$info["cert_fee"],
  895. "cost_fee"=>$info["cost_fee"],
  896. "num"=>$bidinfo["num"],
  897. ];
  898. if($info['is_gold_price']==1){
  899. $price = GoldPrice($god, $budget/100);
  900. }else{
  901. $price = GoodPrice($god, $budget/100);
  902. }
  903. $info['specinfo'] = json_decode($info['specinfo'],true);
  904. $info['sale_price'] =round($price,2);
  905. $bargain =Db::name("bargain_order")->where(['bidsNo'=>$bidNo,"is_del"=>0])->find();
  906. $info['bargain'] =$bargain;
  907. return app_show(0,"获取成功",$info);
  908. }
  909. public function feededit(){
  910. $bidNo= isset($this->post['bidNo'])&&$this->post['bidNo']!=""?trim($this->post['bidNo']):"";
  911. if($bidNo==""){
  912. return error_show(1002,"参数bidNo不能为空");
  913. }
  914. $bidinfo = Db::name("consult_bids")->where(["bidNo"=>$bidNo,"is_del"=>0])->find();
  915. if($bidinfo==false){
  916. return error_show(1003,"未找到信息数据");
  917. }
  918. if($bidinfo['status']>=5){
  919. return error_show(1004,"咨询单已确认无法修改");
  920. }
  921. $zxinfo = Db::name("consult_info")->where(["infoNo"=>$bidinfo['infoNo'],"is_del"=>0])->find();
  922. if($zxinfo==false){
  923. return error_show(1003,"未找到信息数据");
  924. }
  925. $pname = isset($this->post['pname'])&&$this->post['pname']!=""? trim($this->post['pname']):"";
  926. if($pname==""){
  927. return error_show(1002,"参数pname不能为空");
  928. }
  929. $brandid = isset($this->post['brandid'])&&$this->post['brandid']!=""? intval($this->post['brandid']):"";
  930. // if($brandid==""){
  931. // return error_show(1002,"参数brandid不能为空");
  932. // }
  933. $cat_id = isset($this->post['cat_id'])&&$this->post['cat_id']!=""? trim($this->post['cat_id']):"";
  934. if($cat_id==""){
  935. return error_show(1002,"参数cat_id不能为空");
  936. }
  937. $specin= isset($this->post['specinfo'])&&!empty($this->post['specinfo'])?$this->post['specinfo']:"";
  938. if($specin==""){
  939. return error_show(1003,"参数specinfo不能为空");
  940. }
  941. $specinfo=[];
  942. foreach ($specin as $v){
  943. $spec =Db::name("specs")->where(["id"=>$v['specid']])->find();
  944. $spec_value =Db::name("spec_value")->where(["id"=>$v['spec_value_id']])->find();
  945. $v['spec_name']=isset($spec['spec_name'])?$spec['spec_name']:"";
  946. $v['spec_value_name']=isset($spec_value['spec_value'])?$spec_value['spec_value']:"";
  947. $specinfo[]=$v;
  948. }
  949. $unit_id = isset($this->post['unit_id'])&&$this->post['unit_id']!=""? intval($this->post['unit_id']):"";
  950. $cost_desc = isset($this->post['cost_desc'])&&$this->post['cost_desc']!=""? trim($this->post['cost_desc']):"";
  951. $work_day = isset($this->post['work_day'])&&$this->post['work_day']!=""? intval($this->post['work_day']):"";
  952. $delivery_day = isset($this->post['delivery_day'])&&$this->post['delivery_day']!=""? intval($this->post['delivery_day']):"";
  953. $good_img = isset($this->post['good_img'])&&$this->post['good_img']!=""? trim($this->post['good_img']):"";
  954. $expire_day = isset($this->post['expire_day'])&&$this->post['expire_day']!=""? intval($this->post['expire_day'])
  955. :"";
  956. $origin_place = isset($this->post['origin_place'])&&$this->post['origin_place']!=""? trim($this->post['origin_place']):"";
  957. $supplierNo = isset($this->post['supplierNo'])&&$this->post['supplierNo']!=""? trim($this->post['supplierNo']):"";
  958. $pay_way = isset($this->post['pay_way'])&&$this->post['pay_way']!=""? intval($this->post['pay_way']):"";
  959. $tax = isset($this->post['tax'])&&$this->post['tax']!=""? trim($this->post['tax']):"";
  960. $send_way = isset($this->post['send_way'])&&$this->post['send_way']!=""? intval($this->post['send_way']):"";
  961. $metal_id = isset($this->post['metal_id'])&&$this->post['metal_id']!=""? intval($this->post['metal_id']):"";
  962. $is_gold_price = isset($this->post['is_gold_price'])&&$this->post['is_gold_price']!=""? intval($this->post['is_gold_price']):"";
  963. $config = isset($this->post['config'])&&$this->post['config']!=""? $this->post['config']:"";
  964. $weight = isset($this->post['weight'])&&$this->post['weight']!=""? floatval($this->post['weight']):"";
  965. $demo_fee = isset($this->post['demo_fee'])&&$this->post['demo_fee']!=""? floatval($this->post['demo_fee']):"";
  966. $delivery_fee = isset($this->post['delivery_fee'])&&$this->post['delivery_fee']!=""? floatval($this->post['delivery_fee']):"";
  967. $open_fee = isset($this->post['open_fee'])&&$this->post['open_fee']!=""? floatval($this->post['open_fee']):"";
  968. $pakge_fee = isset($this->post['pakge_fee'])&&$this->post['pakge_fee']!=""? floatval($this->post['pakge_fee']):"";
  969. $nake_fee = isset($this->post['nake_fee'])&&$this->post['nake_fee']!=""? floatval($this->post['nake_fee']):"";
  970. $mark_fee = isset($this->post['mark_fee'])&&$this->post['mark_fee']!=""? floatval($this->post['mark_fee']):"";
  971. $cert_fee = isset($this->post['cert_fee'])&&$this->post['cert_fee']!=""? floatval($this->post['cert_fee']):"";
  972. $cost_fee = isset($this->post['cost_fee'])&&$this->post['cost_fee']!=""? floatval($this->post['cost_fee']):"";
  973. $total_fee = isset($this->post['total_fee'])&&$this->post['total_fee']!=""? floatval($this->post['total_fee']):"";
  974. $is_diff = isset($this->post['is_diff'])&&$this->post['is_diff']!==""? intval($this->post['is_diff']):"";
  975. $supply_area = isset($this->post['supply_area'])&&$this->post['supply_area']!==""? intval($this->post['supply_area']):"";
  976. $remark = isset($this->post['remark'])&&$this->post['remark']!=""? trim($this->post['remark']):"";
  977. $data=[
  978. "good_name"=>$pname,
  979. "brand_id"=>$brandid,
  980. "cat_id"=>$cat_id,
  981. "specinfo"=>json_encode($specinfo),
  982. // "material"=>$material,
  983. "unit_id"=>$unit_id,
  984. "cost_desc"=>$cost_desc,
  985. "work_day"=>$work_day,
  986. "delivery_day"=>$delivery_day,
  987. "good_img"=>$good_img,
  988. "expire_day"=>$expire_day,
  989. "origin_place"=>$origin_place,
  990. "supplierNo"=>$supplierNo,
  991. "pay_way"=>$pay_way,
  992. "tax"=>$tax,
  993. "send_way"=>$send_way,
  994. "metal_id"=>$metal_id,
  995. "is_gold_price"=>$is_gold_price,
  996. "config"=>$config,
  997. "weight"=>$weight,
  998. "is_diff"=>$is_diff,
  999. "demo_fee"=>$demo_fee,
  1000. "delivery_fee"=>$delivery_fee,
  1001. "open_fee"=>$open_fee,
  1002. "pakge_fee"=>$pakge_fee,
  1003. "nake_fee"=>$nake_fee,
  1004. "mark_fee"=>$mark_fee,
  1005. "cert_fee"=>$cert_fee,
  1006. "cost_fee"=>$cost_fee,
  1007. "total_fee"=>$total_fee,
  1008. "supply_area"=>$supply_area,
  1009. "remark"=>$remark,
  1010. "updatetime"=>date("Y-m-d H:i:s")
  1011. ];
  1012. $insert= Db::name("consult_bids")->where($bidinfo)->save($data);
  1013. if($insert){
  1014. return app_show(0,"编辑成功");
  1015. }else{
  1016. return error_show(1004,"编辑失败");
  1017. }
  1018. }
  1019. public function bargain_add(){
  1020. $bidNo = isset($this->post['bidNo'])&& $this->post['bidNo']!=""?trim($this->post['bidNo']):"";
  1021. if($bidNo===""){
  1022. return error_show(1004,"参数bidNo不能为空");
  1023. }
  1024. $info =Db::name("consult_bids")->where(['bidNo'=>$bidNo,"is_del"=>0])->find();
  1025. if($info==false){
  1026. return error_show(1004,"未找到商品数据");
  1027. }
  1028. $infos =Db::name("consult_info")->where(['infoNo'=>$info['infoNo'],"is_del"=>0])->find();
  1029. if($infos==false){
  1030. return error_show(1004,"未找到商品数据");
  1031. }
  1032. $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
  1033. if($token==''){
  1034. return error_show(1005,"参数token不能为空");
  1035. }
  1036. $user =GetUserInfo($token);
  1037. if(empty($user)||$user['code']!=0){
  1038. return error_show(1002,"用户数据不存在");
  1039. }
  1040. $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
  1041. $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
  1042. $bargainNo =makeNo("BAR");
  1043. Db::startTrans();
  1044. try{
  1045. $data=[
  1046. "bidsNo"=>$bidNo,
  1047. "bargainNo"=>$bargainNo,
  1048. "bargain_type"=>1,
  1049. "sale_price"=>$info['sale_price'],
  1050. "cost_before_price"=>$info['cost_fee'],
  1051. "cost_after_price"=>$info['cost_fee'],
  1052. "before_rate"=>$info['cost_fee'],
  1053. "after_rate"=>$info['cost_fee'],
  1054. "after_price"=>$infos['budget_price'],
  1055. "status"=>1,
  1056. "is_del"=>0,
  1057. "creater"=>$creater,
  1058. "createrid"=>$createrid,
  1059. "addtime"=>date("Y-m-d H:i:s"),
  1060. "updatetime"=>date("Y-m-d H:i:s")
  1061. ];
  1062. $int = Db::name("bargain_order")->insert($data);
  1063. if($int){
  1064. $info['status']=3;
  1065. $info['updatetime']=date("Y-m-d H:i:s");
  1066. $up =Db::name("consult_bids")->save($info);
  1067. if($up){
  1068. Db::commit();
  1069. return app_show(0,"议价单生成成功",["bargainNo"=>$bargainNo]);
  1070. }
  1071. }
  1072. }catch (\Exception $e){
  1073. Db::rollback();
  1074. return error_show(1004,$e->getMessage());
  1075. }
  1076. }
  1077. public function bargain_status(){
  1078. $bargainNo = isset($this->post['bargainNo'])&& $this->post['bargainNo']!=""?trim($this->post['bargainNo']):"";
  1079. if($bargainNo===""){
  1080. return error_show(1004,"参数bargainNo不能为空");
  1081. }
  1082. $info =Db::name("bargain_order")->where(['bargainNo'=>$bargainNo,"is_del"=>0])->find();
  1083. if($info==false){
  1084. return error_show(1004,"未找到议价数据");
  1085. }
  1086. $bids=Db::name("consult_bids")->where(["bidNo"=>$info["bidsNo"],"is_del"=>0])->find();
  1087. if($bids==false){
  1088. return error_show(1004,"未找到商品数据");
  1089. }
  1090. $status = isset($this->post['status'])&& $this->post['status']!=='' ? intval($this->post['status']):"";
  1091. if($status==''){
  1092. return error_show(1005,"参数status不能为空");
  1093. }
  1094. Db::startTrans();
  1095. try{
  1096. $info['status'] =$status;
  1097. $info['updatetime'] =date("Y-m-d H:i:s");
  1098. $up =Db::name("bargain_order")->save($info);
  1099. if($up){
  1100. if($status==4){
  1101. $bids['status']=4;
  1102. $bids['sale_price']=$info['after_price'];
  1103. $bids['updatetime']=date("Y-m-d H:i:s");
  1104. $up =Db::name("consult_bids")->save($bids);
  1105. if($up==false){
  1106. Db::rollback();
  1107. return error_show(1004,"数据更新失败");
  1108. }
  1109. }
  1110. if($status==5||$status==6||$status==7){
  1111. $bids['status']=4;
  1112. $bids['updatetime']=date("Y-m-d H:i:s");
  1113. $up =Db::name("consult_bids")->save($bids);
  1114. if($up==false){
  1115. Db::rollback();
  1116. return error_show(1004,"数据更新失败");
  1117. }
  1118. }
  1119. Db::commit();
  1120. return app_show(0,"更新成功");
  1121. }
  1122. }catch (\Exception $e){
  1123. Db::rollback();
  1124. return error_show(1004,$e->getMessage());
  1125. }
  1126. }
  1127. public function bargain_info(){
  1128. $bargainNo = isset($this->post['bargainNo'])&& $this->post['bargainNo']!=""?trim($this->post['bargainNo']):"";
  1129. if($bargainNo===""){
  1130. return error_show(1004,"参数bargainNo不能为空");
  1131. }
  1132. $info =Db::name("bargain_order")->where(['bargainNo'=>$bargainNo,"is_del"=>0])->find();
  1133. if($info==false){
  1134. return error_show(1004,"未找到议价数据");
  1135. }
  1136. return app_show(0,"获取成功",$info);
  1137. }
  1138. public function bidlist(){
  1139. $page = isset($this->post['page']) && $this->post['page'] !== "" ? intval($this->post['page']) :"1";
  1140. $size = isset($this->post['size']) && $this->post['size'] !== "" ? intval($this->post['size']) :"10";
  1141. $where=[['is_del',"=",0]];
  1142. $zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
  1143. if ($zxNo !== "") {
  1144. $where[] = ['zxNo','=',$zxNo];
  1145. }
  1146. $infoNo = isset($this->post['infoNo']) && $this->post['infoNo'] !== "" ? trim($this->post['infoNo']) : "";
  1147. if ($infoNo !== "") {
  1148. $where[] = ['infoNo','=',$infoNo];
  1149. }
  1150. $bidNo = isset($this->post['bidNo']) && $this->post['bidNo'] !== "" ? trim($this->post['bidNo']) : "";
  1151. if ($bidNo !== "") {
  1152. $where[] = ['bidNo','=',$bidNo];
  1153. }
  1154. $pgNo = isset($this->post['pgNo']) && $this->post['pgNo'] !== "" ? trim($this->post['pgNo']) : "";
  1155. if ($pgNo !== "") {
  1156. $bidinfo = Db::name("consult_info")->where([["pgNo","=",$pgNo],["is_del","=",0]])->column("infoNo");
  1157. $where[] = ['infoNo','in',$bidinfo];
  1158. }
  1159. $bargain_status = isset($this->post['bargain_status']) && $this->post['bargain_status'] !== "" ? intval($this->post['bargain_status']) : "";
  1160. if ($bargain_status !== "") {
  1161. $bidinfo = Db::name("consult_info")->where([["bargain_status","=",$bargain_status],["is_del","=",0]])->column("infoNo");
  1162. $where[] = ['infoNo','in',$bidinfo];
  1163. }
  1164. $projectNo = isset($this->post['projectNo']) && $this->post['projectNo'] !== "" ? trim($this->post['projectNo']) : "";
  1165. if ($projectNo !== "") {
  1166. $zxlist = Db::name("consult_order")->where(["projectNo"=>$projectNo,"is_del"=>0,"is_project"=>1])->column
  1167. ("zxNo");
  1168. $where[] = ['zxNo','in',$zxlist];
  1169. }
  1170. $count = Db::name('consult_bids')->where($where)->count();
  1171. $total = ceil($count / $size);
  1172. $page = $page >= $total ? $total : $page;
  1173. $list =Db::name('consult_bids')->where($where)->page($page,$size)->select();
  1174. $data=[];
  1175. foreach ($list as $value){
  1176. $catinfo = Db::name("cat")->where(["id"=>$value['cat_id']])->find();
  1177. $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
  1178. $unit =Db::name("unit")->where(["id"=>$value['unit_id']])->find();
  1179. $value['unit'] = isset($unit['unit'])?$unit['unit']:'';
  1180. $supplier = Db::name("supplier")->where(["code"=>$value['supplierNo']])->find();
  1181. $value['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
  1182. if($value['brand_id']!=0){
  1183. $brand=Db::name("brand")->where(["id"=>$value['brand_id']])->find();
  1184. $value["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
  1185. }else{
  1186. $value["brand_name"]="";
  1187. $value["brand_id"]="";
  1188. }
  1189. $bidinfo = Db::name("consult_info")->where(["infoNo"=>$value["infoNo"]])->find();
  1190. $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']:100;
  1191. $god=[
  1192. "metal_id"=>$value['metal_id'],
  1193. "weight"=>$value["weight"],
  1194. "demo_fee"=>$value["demo_fee"],
  1195. "delivery_fee"=>$value["delivery_fee"],
  1196. "open_fee"=>$value["open_fee"],
  1197. "packing_fee"=>$value["pakge_fee"],
  1198. "mark_fee"=>$value["mark_fee"],
  1199. "nake_fee"=>$value["nake_fee"],
  1200. "cert_fee"=>$value["cert_fee"],
  1201. "cost_fee"=>$value["cost_fee"],
  1202. "num"=>$bidinfo["num"],
  1203. ];
  1204. if($value['is_gold_price']==1){
  1205. $price = GoldPrice($god, $budget/100);
  1206. }else{
  1207. $price = GoodPrice($god, $budget/100);
  1208. }
  1209. $value['specinfo'] = json_decode($value['specinfo'],true);
  1210. $value['sale_price'] =round($price,2);
  1211. $value['bargain_status']=$bidinfo['bargain_status'];
  1212. $data[]=$value;
  1213. }
  1214. return app_show(0,"获取成功",['count'=>$count,'list'=>$data]);
  1215. }
  1216. public function feedlist(){
  1217. $where=[['is_del',"=",0]];
  1218. $zxNo = isset($this->post['zxNo']) && $this->post['zxNo'] !== "" ? trim($this->post['zxNo']) : "";
  1219. if ($zxNo !== "") {
  1220. $where[] = ['zxNo','=',$zxNo];
  1221. }
  1222. $infoNo = isset($this->post['infoNo']) && $this->post['infoNo'] !== "" ? trim($this->post['infoNo']) : "";
  1223. if ($infoNo !== "") {
  1224. $where[] = ['infoNo','=',$infoNo];
  1225. }
  1226. $bidNo = isset($this->post['bidNo']) && $this->post['bidNo'] !== "" ? trim($this->post['bidNo']) : "";
  1227. if ($bidNo !== "") {
  1228. $where[] = ['bidNo','=',$bidNo];
  1229. }
  1230. $projectNo = isset($this->post['projectNo']) && $this->post['projectNo'] !== "" ? trim($this->post['projectNo']) : "";
  1231. if ($projectNo !== "") {
  1232. $zxlist = Db::name("consult_order")->where(["projectNo"=>$projectNo,"is_del"=>0,"is_project"=>1])->column
  1233. ("zxNo");
  1234. $where[] = ['zxNo','in',$zxlist];
  1235. }
  1236. $token = isset($this->post['token'])&& $this->post['token']!='' ? trim($this->post['token']):"";
  1237. if($token==''){
  1238. return error_show(102,"参数token不能为空");
  1239. }
  1240. $user =GetUserInfo($token);
  1241. if(empty($user)||$user['code']!=0){
  1242. return error_show(105,"用户数据不存在");
  1243. }
  1244. $createrid= isset($user["data"]['id']) ? $user["data"]['id'] : "";
  1245. $creater= isset($user["data"]['nickname']) ? $user["data"]['nickname'] : "";
  1246. $where[] = ["createrid","=",$createrid];
  1247. $list =Db::name('consult_bids')->where($where)->select();
  1248. $data=[];
  1249. foreach ($list as $value){
  1250. $catinfo = Db::name("cat")->where(["id"=>$value['cat_id']])->find();
  1251. $value['can']= isset($value['cat_id']) && $value['cat_id'] !=0 ? made($value['cat_id']):[];
  1252. $unit =Db::name("unit")->where(["id"=>$value['unit_id']])->find();
  1253. $value['unit'] = isset($unit['unit'])?$unit['unit']:'';
  1254. $supplier = Db::name("supplier")->where(["code"=>$value['supplierNo']])->find();
  1255. $value['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
  1256. if($value['brand_id']!=0){
  1257. $brand=Db::name("brand")->where(["id"=>$value['brand_id']])->find();
  1258. $value["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
  1259. }else{
  1260. $value["brand_name"]="";
  1261. $value["brand_id"]="";
  1262. }
  1263. $bidinfo = Db::name("consult_info")->where(["infoNo"=>$value["infoNo"]])->find();
  1264. $budget = isset($catinfo['order_rate']) ? $catinfo['order_rate']:100;
  1265. $god=[
  1266. "metal_id"=>$value['metal_id'],
  1267. "weight"=>$value["weight"],
  1268. "demo_fee"=>$value["demo_fee"],
  1269. "delivery_fee"=>$value["delivery_fee"],
  1270. "open_fee"=>$value["open_fee"],
  1271. "packing_fee"=>$value["pakge_fee"],
  1272. "mark_fee"=>$value["mark_fee"],
  1273. "nake_fee"=>$value["nake_fee"],
  1274. "cert_fee"=>$value["cert_fee"],
  1275. "cost_fee"=>$value["cost_fee"],
  1276. "num"=>$bidinfo["num"],
  1277. ];
  1278. if($value['is_gold_price']==1){
  1279. $price = GoldPrice($god, $budget/100);
  1280. }else{
  1281. $price = GoodPrice($god, $budget/100);
  1282. }
  1283. $value['sale_price'] =round($price,2);
  1284. $value['specinfo'] = json_decode($value['specinfo'],true);
  1285. $value['bargain_status']=$bidinfo['bargain_status'];
  1286. $data[]=$value;
  1287. }
  1288. return app_show(0,"获取成功",$data);
  1289. }
  1290. }