Commit 3da9fcfc authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/0702-v.2.2.0' into 0702-v.2.2.0

parents 7902ecc9 e2e99ac0
...@@ -8,6 +8,7 @@ use app\model\FollowUpLogModel; ...@@ -8,6 +8,7 @@ use app\model\FollowUpLogModel;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OImg;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\OPartialCommission; use app\model\OPartialCommission;
use app\model\OPayLogModel; use app\model\OPayLogModel;
...@@ -76,6 +77,9 @@ class OrderLogService ...@@ -76,6 +77,9 @@ class OrderLogService
} }
} }
if ($father_id > 0) { if ($father_id > 0) {
//保存图片
$oImgModel = new OImg();
$oImgModel->addImgAll($father_id,2,$transfer_img);
$pushMarchIn = new PushMessageService($params["report_id"], 2); $pushMarchIn = new PushMessageService($params["report_id"], 2);
$pushMarchIn->pushMarchInMessage($params["report_id"], 2); //推送 $pushMarchIn->pushMarchInMessage($params["report_id"], 2); //推送
} }
......
...@@ -152,4 +152,8 @@ class News extends Basic ...@@ -152,4 +152,8 @@ class News extends Basic
$data = $label->getList(1, 200, '', 'id,label_name', ['status'=>0]); $data = $label->getList(1, 200, '', 'id,label_name', ['status'=>0]);
return $this->response(200, '', $data); return $this->response(200, '', $data);
} }
public function newText() {
return view('new_text');
}
} }
\ No newline at end of file
This diff is collapsed.
<?php
namespace app\model;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/7/4
* Time : 10:15
* Intro:
*/
use think\Db;
use think\Exception;
class OImg extends BaseModel
{
protected $table = "o_img";
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* 新增图片一张
* @param $params
* @return int|string
* @throws Exception xx
*/
public function addImgOnce(array $params): int
{
$imgBin = $this->imgBin($params);
Db::startTrans();
try {
$id = $this->insertGetId($imgBin);
Db::commit();
return $id;
} catch (Exception $exception) {
Db::rollback();
throw $exception;
}
}
/**
* 新增多张图片
* @param $params
* @param $img_id
* @param $img_type
* @return int|string
* @throws Exception xx
*/
public function addImgAll(int $img_id, int $img_type,array $params): int
{
$imgBin = [];
foreach ($params as $item) {
$insert_["img_id"] = $img_id;
$insert_["img_type"] = $img_type;
$insert_["img_name"] = $item;
$insert_["img_status"] = 0;
array_push($imgBin, $this->imgBin($insert_));
}
Db::startTrans();
try {
$this->saveAll($imgBin);
Db::commit();
return 1;
} catch (Exception $exception) {
Db::rollback();
throw $exception;
}
}
/**
* 修改图片单张
* @param array $params
* @return int
* @throws Exception
*/
public function updateImgStatus(array $params): int
{
$imgBin = $this->imgBin($params);
Db::startTrans();
try {
$this->update($imgBin);
Db::commit();
return $params["id"];
} catch (Exception $exception) {
Db::rollback();
throw $exception;
}
}
/**
* 根据id和类型获取图片
* @param array $params
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
*/
public function getImgList(array $params, string $field = "id")
{
if (isset($params["img_id"])) {
$where_["img_id"] = $params["img_id"];
}
if (isset($params["img_type"])) {
$where_["img_type"] = $params["img_type"];
}
$where_["img_status"] = 0;
return $this
->field($field)
->where($where_)
->select();
}
/**
* bin
* @param $params
* @return array
*/
private function imgBin($params)
{
$arr = [];
if (isset($params["id"])) {
$arr["id"] = $params["id"];
} else {
$arr["create_time"] = date("Y-m-d H:i:s", time());
}
if (isset($params["img_id"])) {
$arr["img_id"] = $params["img_id"];
}
if (isset($params["img_type"])) {
$arr["img_type"] = $params["img_type"];
}
if (isset($params["img_name"])) {
$arr["img_name"] = $params["img_name"];
}
if (isset($params["img_status"])) {
$arr["img_status"] = $params["img_status"];
}
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
}
}
\ No newline at end of file
...@@ -251,6 +251,7 @@ Route::group('index', [ ...@@ -251,6 +251,7 @@ Route::group('index', [
'getNewsInfo' => [ 'index/news/getNewsInfo', [ 'method' => 'GET' ] ], //商学院资讯详情 'getNewsInfo' => [ 'index/news/getNewsInfo', [ 'method' => 'GET' ] ], //商学院资讯详情
'getNewsLabel' => [ 'index/news/getNewsLabel', [ 'method' => 'GET' ] ], //商学院资标签 'getNewsLabel' => [ 'index/news/getNewsLabel', [ 'method' => 'GET' ] ], //商学院资标签
'delNews' => [ 'index/news/delNews', [ 'method' => 'POST' ] ], //删除商学院文章 'delNews' => [ 'index/news/delNews', [ 'method' => 'POST' ] ], //删除商学院文章
'new_text' => [ 'index/news/newText', [ 'method' => 'GET' ] ], //删除商学院文章
'agentEvaluateNumAndFraction' => [ 'index/agent/agentEvaluateNumAndFraction', [ 'method' => 'POST|GET' ] ],//经纪人列表计算-评价次数和分数 朱伟 2018-07-03 'agentEvaluateNumAndFraction' => [ 'index/agent/agentEvaluateNumAndFraction', [ 'method' => 'POST|GET' ] ],//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'uploadImg' => [ 'index/UploadImg/uploadImg', [ 'method' => 'POST' ] ],//全局图片上传 'uploadImg' => [ 'index/UploadImg/uploadImg', [ 'method' => 'POST' ] ],//全局图片上传
]); ]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment